Robert Brewer wrote:
> There's a typo in the code snippets at the moment.
>
> The translation of the above statement is:
>
> abc = EXPR
> exc = () # Or (None, None, None) ?
> try:
> try:
> VAR = abc.__enter__()
> BLOCK
> except:
> exc = sys.exc_info()
> raise
> finally:
> abc.__exit__(exc)
>
> I think you meant "abc.__exit__(*exc)". Assuming that, then "exc =
> (None, None, None)" makes the most sense. If exc_info() is going to be
> passed as a single arg, then I'd rather have the default "exc = ()", so
> I can simply check "if exc:" in the __exit__ method.
Also, the call to __enter__() needs to be before the try/finally block (as it
is
in PEP 310). Otherwise we get the "releasing a lock you failed to acquire"
problem.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---------------------------------------------------------------
http://boredomandlaziness.blogspot.com
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com