getting errno from OSError exception?
ml at dynkin.com
Mon Sep 13 20:01:09 CEST 2004
Mark Harrison wrote:
> Can somebody loan me a clue as to how to check the errno on
> an OSError, as described below?
> except OSError:
> # if errno == 17 then silently ignore the error because the
> # other process won the race condition and created the directory
> # otherwise, allow the exception to percolate up the call stack
> # and be caught by the standard error reporter
What about this?
except OSError, e:
if e.errno == 17:
More information about the Python-list