simpler exception printing
This commit is contained in:
@@ -52,16 +52,10 @@ Please file a bug report. (http://bugs.uludag.org.tr)"""))
|
||||
show_traceback = ctx.get_option('debug')
|
||||
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'):
|
||||
ui.error("%s: %s" % (exception, v))
|
||||
ui.error(u"%s: %s" % (exception, value))
|
||||
else:
|
||||
ui.error(v)
|
||||
ui.error(unicode(value))
|
||||
|
||||
ui.info(_("Please use 'pisi help' for general help."))
|
||||
|
||||
|
||||
+2
-2
@@ -21,11 +21,11 @@ __all__ = [ 'api', 'config', 'packagedb', 'installdb', 'search' ]
|
||||
class Exception(Exception):
|
||||
"""Class of exceptions that must be caught and handled within PISI"""
|
||||
def __str__(self):
|
||||
s = ''
|
||||
s = u''
|
||||
for x in self.args:
|
||||
if s != '':
|
||||
s += '\n'
|
||||
s += x.encode('utf-8')
|
||||
s += unicode(x)
|
||||
return s
|
||||
|
||||
class Error(Exception):
|
||||
|
||||
Reference in New Issue
Block a user