Fixed a potential encoding issue when printing exception messages.

This commit is contained in:
Adam Waldenberg 2013-07-10 16:45:12 +02:00
parent 2df9a31b60
commit aeb55c5a3e

View file

@ -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)