Redirecting stderr for extension modules
Jeff Epler
jepler at unpythonic.net
Thu May 15 12:48:47 EDT 2003
More information about the Python-list mailing list
Thu May 15 12:48:47 EDT 2003
- Previous message (by thread): Redirecting stderr for extension modules
- Next message (by thread): Redirecting stderr for extension modules
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Michael,
I think that what happens is that the return value (a tuple) is
constructed in the line
return result, stderr
and then the body of the 'finally' is executed, setting stderr to a
different value.
You can write it this way (with the repeated 'if file: ...' block)
try:
result = fn( *args, *kwds)
except:
if file: ...
raise
else:
if file: ...
return result, stderr
Jeff
- Previous message (by thread): Redirecting stderr for extension modules
- Next message (by thread): Redirecting stderr for extension modules
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list