Raising a specific OSError

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Sat Apr 22 05:21:51 EDT 2006


In article <mailman.4855.1145658087.27775.python-list at python.org>,
 David Hirschfield <davidh at ilm.com> wrote:

>When I attempt to perform a file operation on a non-existent file, I get 
>an OSError: [Errno 2], but what if I want to raise one of those myself?

raise OSError(2, "No such file or directory")



More information about the Python-list mailing list