Re: Global "except" condition

2006-07-11 Thread Fredrik Lundh
Ernesto wrote: > Within the scope of one Python file (say myFile.py), I'd like to print > a message on ANY exception that occurs in THAT file, dependent on a > condition. condition = True def handle_any_exception(function): def trampoline(*args, **kwargs): try:

Re: Global "except" condition

2006-07-11 Thread Steve Holden
Ernesto wrote: > Within the scope of one Python file (say myFile.py), I'd like to print > a message on ANY exception that occurs in THAT file, dependent on a > condition. > > Here's the pseudocode: > > if anyExceptionOccurs(): > if myCondition: > print "Here's my global exceptio

Re: Global "except" condition

2006-07-10 Thread Simon Forman
Ernesto wrote: > Within the scope of one Python file (say myFile.py), I'd like to print > a message on ANY exception that occurs in THAT file, dependent on a > condition. > > Here's the pseudocode: > > if anyExceptionOccurs(): > if myCondition: > print "Here's my global exception

Global "except" condition

2006-07-10 Thread Ernesto
Within the scope of one Python file (say myFile.py), I'd like to print a message on ANY exception that occurs in THAT file, dependent on a condition. Here's the pseudocode: if anyExceptionOccurs(): if myCondition: print "Here's my global exception message" Is this functionalit