diff -r bdfaec90d665 distutils2/command/cmd.py --- a/distutils2/command/cmd.py Sun Oct 03 12:30:06 2010 +0200 +++ b/distutils2/command/cmd.py Sun Oct 03 17:35:21 2010 +0200 @@ -6,7 +6,9 @@ __revision__ = "$Id: cmd.py 75192 2009-10-02 23:49:48Z tarek.ziade $" -import os, re +import errno +import os +import re from distutils2.errors import DistutilsOptionError from distutils2 import util from distutils2 import log @@ -386,7 +388,11 @@ log.info("created directory %s%s", head, part) head += part + os.sep return - os.makedirs(name, mode) + try: + os.makedirs(name, mode) + except OSError as e: + if not (e.errno == errno.EEXIST and os.path.isdir(name)): + raise def copy_file(self, infile, outfile, preserve_mode=1, preserve_times=1, link=None, level=1): diff -r bdfaec90d665 distutils2/compiler/ccompiler.py --- a/distutils2/compiler/ccompiler.py Sun Oct 03 12:30:06 2010 +0200 +++ b/distutils2/compiler/ccompiler.py Sun Oct 03 17:35:21 2010 +0200 @@ -5,6 +5,7 @@ __revision__ = "$Id: ccompiler.py 77704 2010-01-23 09:23:15Z tarek.ziade $" +import errno import sys import os import re @@ -944,7 +945,11 @@ log.info("created directory %s%s", head, part) head += part + os.sep return - os.makedirs(name, mode) + try: + os.makedirs(name, mode) + except OSError as e: + if not (e.errno == errno.EEXIST and os.path.isdir(name)): + raise # Map a sys.platform/os.name ('posix', 'nt') to the default compiler