[llvm-commits] [LNT] r167367 - /lnt/trunk/lnt/testing/util/commands.py
Michael Gottesman
mgottesman at apple.com
Sat Nov 3 22:04:36 PDT 2012
Author: mgottesman
Date: Sun Nov 4 00:04:36 2012
New Revision: 167367
URL: http://llvm.org/viewvc/llvm-project?rev=167367&view=rev
Log:
[lnt util] Change mkdir_p to use os.makedirs instead of recursion + os.mkdir.
Modified:
lnt/trunk/lnt/testing/util/commands.py
Modified: lnt/trunk/lnt/testing/util/commands.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/util/commands.py?rev=167367&r1=167366&r2=167367&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/util/commands.py (original)
+++ lnt/trunk/lnt/testing/util/commands.py Sun Nov 4 00:04:36 2012
@@ -36,17 +36,10 @@
will also make directories for any missing parent directories."""
import errno
- if not path or os.path.exists(path):
- return
-
- parent = os.path.dirname(path)
- if parent != path:
- mkdir_p(parent)
-
try:
- os.mkdir(path)
- except OSError,e:
- # Ignore EEXIST, which may occur during a race condition.
+ os.makedirs(path)
+ except OSError as e:
+ # Ignore EEXIST, which may occur during a race condition.
if e.errno != errno.EEXIST:
raise
More information about the llvm-commits
mailing list