I wrote:

>    try:
>       os.makedirs("/tmp/trh/spam/norwegian/blue/parrot/cheese")
>    except os.error, e:
>       if e.errno != errno.EEXIST:
>           raise

Actually, when I think more about it, one would probably rather
want something like:

    try:
        os.makedirs("/tmp/trh/spam/norwegian/blue/parrot/cheese")
    except os.error, e:
        if ( e.errno != errno.EEXIST  or
             not os.path.isdir("/tmp/trh/spam/norwegian/blue/parrot/cheese")):
            raise


-- 
Thomas Bellman,   Lysator Computer Club,   Linköping University,  Sweden
"Beware of bugs in the above code; I have    !  bellman @ lysator.liu.se
 only proved it correct, not tried it."      !  Make Love -- Nicht Wahr!
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to