My first Python program

Hallvard B Furuseth h.b.furuseth at usit.uio.no
Tue Oct 12 16:19:51 EDT 2010


I wrote:
>     except IOError:
>         if e.errno != errno.ENOENT: raise    # if you are picky

Argh, I meant "except IOError, e:".  That's for Python 2 but not
Python 3.  "except IOError as e:" works on Python 2.6 and above.

-- 
Hallvard



More information about the Python-list mailing list