All Samples(1084) | Call(1012) | Derive(0) | Import(72)
Print exception up to 'limit' stack trace entries from 'tb' to 'file'. This differs from print_tb() in the following ways: (1) if traceback is not None, it prints a header "Traceback (most recent call last):"; (2) it prints the exception type and value after the stack trace; (3) if type is SyntaxError and value has the appropriate format, it prints the line where the syntax error occurred with a caret on the next line indicating the approximate position of the error.
def print_exception(etype, value, tb, limit=None, file=None):
"""Print exception up to 'limit' stack trace entries from 'tb' to 'file'.
This differs from print_tb() in the following ways: (1) if
traceback is not None, it prints a header "Traceback (most recent
call last):"; (2) it prints the exception type and value after the
stack trace; (3) if type is SyntaxError and value has the
appropriate format, it prints the line where the syntax error
occurred with a caret on the next line indicating the approximate
position of the error.
"""
if file is None:
file = sys.stderr
if tb:
_print(file, 'Traceback (most recent call last):')
print_tb(tb, limit, file)
lines = format_exception_only(etype, value)
for line in lines:
_print(file, line, '')
except:
print "problems drawing: -------------"
exceptionType, exceptionValue, exceptionTraceback = sys.exc_info()
traceback.print_exception(exceptionType, exceptionValue,
exceptionTraceback,
limit=2, file=sys.stdout)
print "-------------------------------"
src/d/a/DAQpy-HEAD/examples/test_utils.py DAQpy(Download)
def pprint_exc(exception = None): if exception is None: exception = sys.exc_info() with contextlib.closing(StringIO.StringIO()) as stream: traceback.print_exception(exception[0], exception[1], exception[2], file=stream) return stream.getvalue()
src/c/e/cerebrum-HEAD/trunk/cerebrum/clients/examples/passweb.py cerebrum(Download)
exc_type, exc_value
))
traceback.print_exception(
exc_type,
exc_value,
exc_traceback,
None,
src/c/e/cerebrum-HEAD/cerebrum/clients/examples/passweb.py cerebrum(Download)
exc_type, exc_value
))
traceback.print_exception(
exc_type,
exc_value,
exc_traceback,
None,
src/d/j/django-navbar-0.3.0/examples/dbgp/_logging/__init__.py django-navbar(Download)
traceback.print_exception()
"""
sio = cStringIO.StringIO()
traceback.print_exception(ei[0], ei[1], ei[2], None, sio)
s = sio.getvalue()
sio.close()
if s[-1] == "\n":
"""
if raiseExceptions:
ei = sys.exc_info()
traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr)
del ei
class StreamHandler(Handler):
src/d/j/django-navbar-0.3.0/examples/dbgp/_logging/config.py django-navbar(Download)
root.manager.loggerDict[log].disabled = 1
except:
ei = sys.exc_info()
traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr)
del ei
finally:
logging._releaseLock()
src/b/l/blueplanet-HEAD/Versions/Version 273/blueplanet/example_clients/primitive_plant.py blueplanet(Download)
def handle_error(self, ty, er, tb):
if not 'idlelib' in globals():
traceback.print_exception(ty, er, tb)
class PrimitivePlantPopulation(GeneticClient):
interface= PrimitivePlant
maxdeadcount= 2
src/b/l/blueplanet-HEAD/Versions/Version 273/blueplanet/example_clients/It_knuspertier.py blueplanet(Download)
def handle_error(self, ty, er, tb):
if ty not in (ReferenceError, ):# and not 'idlelib' in globals():
print 'handle_error:'
traceback.print_exception(ty, er, tb)
## real_interp= GeneticCreature.interpret
## def interpret(self, offset= None):
src/b/l/blueplanet-HEAD/Versions/Version 273/blueplanet/example_clients/It_cone_plant.py blueplanet(Download)
def handle_error(self, ty, er, tb):
if ty not in (ReferenceError, ):# and not 'idlelib' in globals():
print 'handle_error:'
traceback.print_exception(ty, er, tb)
## real_interp= GeneticCreature.interpret
## def interpret(self, offset= None):
src/b/l/blueplanet-HEAD/Versions/Version 273/blueplanet/example_clients/cone_plant.py blueplanet(Download)
def handle_error(self, ty, er, tb):
if not 'idlelib' in globals() and ty not in (ReferenceError, ):
traceback.print_exception(ty, er, tb)
## real_interp= GeneticCreature.interpret
## def interpret(self, offset= None):
## print 'interpret', offset, self.offset, self.get(self.offset)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next