diff options
author | Meador Inge <meadori@gmail.com> | 2011-11-28 15:27:32 (GMT) |
---|---|---|
committer | Meador Inge <meadori@gmail.com> | 2011-11-28 15:27:32 (GMT) |
commit | 22b9b379159f953ad4805980644414354030624f (patch) | |
tree | 7a3d34e3da6f91ca9f877907fe16e09a40347d8a /Lib/py_compile.py | |
parent | 7be8f68d37b82ffd901eb07fee4ed92a5c8955dc (diff) | |
download | cpython-22b9b379159f953ad4805980644414354030624f.zip cpython-22b9b379159f953ad4805980644414354030624f.tar.gz cpython-22b9b379159f953ad4805980644414354030624f.tar.bz2 |
Issue #12618: py_compile cannot create files in current directory
Initial patch by Sjoerd de Vries.
Diffstat (limited to 'Lib/py_compile.py')
-rw-r--r-- | Lib/py_compile.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/py_compile.py b/Lib/py_compile.py index e0f98cb..5adb70a 100644 --- a/Lib/py_compile.py +++ b/Lib/py_compile.py @@ -130,7 +130,9 @@ def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1): else: cfile = imp.cache_from_source(file) try: - os.makedirs(os.path.dirname(cfile)) + dirname = os.path.dirname(cfile) + if dirname: + os.makedirs(dirname) except OSError as error: if error.errno != errno.EEXIST: raise |