From 8aa5869fb9c15b848eac56fd15525d7ecca7bc0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Mon, 26 Dec 2005 06:20:50 +0000 Subject: [PATCH] simpler exception printing --- pisi-cli | 10 ++-------- pisi/__init__.py | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/pisi-cli b/pisi-cli index ab7f747d..fb2a283c 100755 --- a/pisi-cli +++ b/pisi-cli @@ -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.")) diff --git a/pisi/__init__.py b/pisi/__init__.py index 85264685..c165ea8e 100644 --- a/pisi/__init__.py +++ b/pisi/__init__.py @@ -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):