On Tue, Oct 15, 2013 at 12:45 PM, Ethan Furman <[email protected]> wrote: > with trap(OSError) as cm: > os.unlink('missing.txt') > if cm.exc: > do_something()
.. and why is this better than
try:
os.unlink('missing.txt')
except OSError as exc:
do_something()
?
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
