added safeRepr

This commit is contained in:
Darren Ranalli 2006-05-25 23:21:06 +00:00
parent 6c57da8086
commit 8fb0f4306c

View File

@ -1986,6 +1986,12 @@ def gcDebugOn():
import gc
return (gc.get_debug() & gc.DEBUG_SAVEALL) == gc.DEBUG_SAVEALL
def safeRepr(obj):
try:
return repr(obj)
except:
return '<** FAILED REPR OF %s **>' % obj.__class__.__name__
class ScratchPad:
"""empty class to stick values onto"""
def __init__(self, **kArgs):