summaryrefslogtreecommitdiffstats
path: root/func
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-02-07 14:32:35 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-02-07 14:32:35 -0500
commite26ec793e0b4bbd44f74550119e2948d296dba37 (patch)
treedfb1f852581706df8cd61d768d72ef4d3367633c /func
parent1e963e0ba196482d0ad58090d3ec16f3cc94a9af (diff)
downloadthird_party-func-e26ec793e0b4bbd44f74550119e2948d296dba37.tar.gz
third_party-func-e26ec793e0b4bbd44f74550119e2948d296dba37.tar.xz
third_party-func-e26ec793e0b4bbd44f74550119e2948d296dba37.zip
Possible traceback formatting difference on older python?
Diffstat (limited to 'func')
-rwxr-xr-xfunc/utils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/func/utils.py b/func/utils.py
index 54c9c39..4aca97e 100755
--- a/func/utils.py
+++ b/func/utils.py
@@ -45,9 +45,12 @@ def daemonize(pidfile=None):
def nice_exception(etype, evalue, etb):
etype = str(etype)
- lefti = etype.index("'") + 1
- righti = etype.rindex("'")
- nicetype = etype[lefti:righti]
+ try:
+ lefti = etype.index("'") + 1
+ righti = etype.rindex("'")
+ nicetype = etype[lefti:righti]
+ except:
+ nicetype = etype
nicestack = string.join(traceback.format_list(traceback.extract_tb(etb)))
return [ REMOTE_ERROR, nicetype, str(evalue), nicestack ]