Kaydet (Commit) 8aa5869f authored tarafından Eray Özkural's avatar Eray Özkural

simpler exception printing

üst 818642a1
...@@ -52,16 +52,10 @@ Please file a bug report. (http://bugs.uludag.org.tr)""")) ...@@ -52,16 +52,10 @@ Please file a bug report. (http://bugs.uludag.org.tr)"""))
show_traceback = ctx.get_option('debug') show_traceback = ctx.get_option('debug')
ui.error(_("System Error. Program Terminated.")) ui.error(_("System Error. Program Terminated."))
# NB: we know this breaks latin-1, it was added by meren
# to circumvent turkish errors when printing python exceptions
v = ''
for e in value.args:
v += str(e) + '\n'
if ctx.get_option('debug'): if ctx.get_option('debug'):
ui.error("%s: %s" % (exception, v)) ui.error(u"%s: %s" % (exception, value))
else: else:
ui.error(v) ui.error(unicode(value))
ui.info(_("Please use 'pisi help' for general help.")) ui.info(_("Please use 'pisi help' for general help."))
......
...@@ -21,11 +21,11 @@ __all__ = [ 'api', 'config', 'packagedb', 'installdb', 'search' ] ...@@ -21,11 +21,11 @@ __all__ = [ 'api', 'config', 'packagedb', 'installdb', 'search' ]
class Exception(Exception): class Exception(Exception):
"""Class of exceptions that must be caught and handled within PISI""" """Class of exceptions that must be caught and handled within PISI"""
def __str__(self): def __str__(self):
s = '' s = u''
for x in self.args: for x in self.args:
if s != '': if s != '':
s += '\n' s += '\n'
s += x.encode('utf-8') s += unicode(x)
return s return s
class Error(Exception): class Error(Exception):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment