getting errno from OSError exception?

Mark Harrison mh at dreadnok.pixar.com
Mon Sep 13 13:42:54 EDT 2004


Can somebody loan me a clue as to how to check the errno on
an OSError, as described below?

try:
    os.makedirs(d)
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


Many TIA!
Mark

-- 
Mark Harrison
Pixar Animation Studios



More information about the Python-list mailing list