You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by ad...@apache.org on 2014/06/23 07:17:14 UTC
svn commit: r1604693 - /labs/panopticon/pan-utils/src/asf/utils/file.py
Author: adc
Date: Mon Jun 23 05:17:13 2014
New Revision: 1604693
URL: http://svn.apache.org/r1604693
Log:
makedirs
Modified:
labs/panopticon/pan-utils/src/asf/utils/file.py
Modified: labs/panopticon/pan-utils/src/asf/utils/file.py
URL: http://svn.apache.org/viewvc/labs/panopticon/pan-utils/src/asf/utils/file.py?rev=1604693&r1=1604692&r2=1604693&view=diff
==============================================================================
--- labs/panopticon/pan-utils/src/asf/utils/file.py (original)
+++ labs/panopticon/pan-utils/src/asf/utils/file.py Mon Jun 23 05:17:13 2014
@@ -17,8 +17,10 @@
# under the License.
#
import contextlib
+import os
import shutil
import tempfile
+import errno
@contextlib.contextmanager
@@ -32,3 +34,13 @@ def temp_directory(*args, **kwargs):
yield path
finally:
shutil.rmtree(path)
+
+
+def makedirs(path):
+ try:
+ os.makedirs(path)
+ except OSError as exc: # Python >2.5
+ if exc.errno == errno.EEXIST and os.path.isdir(path):
+ pass
+ else:
+ raise
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org