Changeset 1400 for pykota

Show
Ignore:
Timestamp:
03/15/04 11:47:56 (21 years ago)
Author:
jalet
Message:

This time the traceback formatting should be correct !

Location:
pykota/trunk/bin
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r1391 r1400  
    2424# 
    2525# $Log$ 
     26# Revision 1.34  2004/03/15 10:47:56  jalet 
     27# This time the traceback formatting should be correct ! 
     28# 
    2629# Revision 1.33  2004/03/05 12:46:07  jalet 
    2730# Improve tracebacks 
     
    492495        except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError, PyKotaAccounterError, PyKotaRequesterError, AttributeError, KeyError, IndexError, ValueError, TypeError, IOError), msg : 
    493496            import traceback 
    494             sys.stderr.write("ERROR : cupspykota backend failed (%s)\n%s" % (msg, "ERROR : ".join(traceback.format_stack()))) 
     497            mm = [((f.endswith('\n') and f) or (f + '\n')) for f in traceback.format_exception(*sys.exc_info())] 
     498            sys.stderr.write("ERROR : cupspykota backend failed (%s)\n%s" % (msg, "ERROR : ".join(mm))) 
    495499            sys.stderr.flush() 
    496500            retcode = 1 
  • pykota/trunk/bin/pykota

    r1391 r1400  
    2424# 
    2525# $Log$ 
     26# Revision 1.57  2004/03/15 10:47:56  jalet 
     27# This time the traceback formatting should be correct ! 
     28# 
    2629# Revision 1.56  2004/03/05 12:46:08  jalet 
    2730# Improve tracebacks 
     
    358361    except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError, PyKotaAccounterError, PyKotaRequesterError, AttributeError, KeyError, IndexError, ValueError, TypeError, IOError), msg : 
    359362        import traceback 
    360         sys.stderr.write("ERROR : PyKota filter failed (%s)\n%s" % (msg, "ERROR : ".join(traceback.format_stack()))) 
     363        mm = [((f.endswith('\n') and f) or (f + '\n')) for f in traceback.format_exception(*sys.exc_info())] 
     364        sys.stderr.write("ERROR : pykota filter failed (%s)\n%s" % (msg, "ERROR : ".join(mm))) 
    361365        sys.stderr.flush() 
    362366        try :