mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-11-16 00:28:25 +01:00
Fixed a potential encoding issue when printing exception messages.
This commit is contained in:
parent
2df9a31b60
commit
aeb55c5a3e
1 changed files with 8 additions and 1 deletions
|
@ -21,6 +21,13 @@
|
|||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#Small fix for Python 3
|
||||
try:
|
||||
unicode
|
||||
except NameError:
|
||||
def unicode(string):
|
||||
return str(string)
|
||||
|
||||
import localization
|
||||
localization.init()
|
||||
|
||||
|
@ -160,7 +167,7 @@ def main():
|
|||
localization.enable()
|
||||
|
||||
print(sys.argv[0], "\b:", end=" ")
|
||||
print(msg)
|
||||
print(unicode(msg))
|
||||
print(_("Try `{0} --help' for more information.").format(sys.argv[0]))
|
||||
sys.exit(2)
|
||||
|
||||
|
|
Loading…
Reference in a new issue