
May 19, 2011
12:13 a.m.
Devin Jeanpierre wrote:
On Wed, May 18, 2011 at 6:07 AM, dag.odenhall@gmail.com <dag.odenhall@gmail.com> wrote:
except IOError(32): # isinstance IOError and .args == (32,) ...
Unfortunately, as described it wouldn't match IOError(32, 'Blah blah blah').
Also it's a bit magical -- normally one doesn't expect Haskell-like pattern matching in Python. Maybe something more explicit would be better: try: ... except IOError as e with e.errno == 32: ... -- Greg