diff options
| author | Meador Inge <meadori@gmail.com> | 2011-11-28 15:34:47 (GMT) |
|---|---|---|
| committer | Meador Inge <meadori@gmail.com> | 2011-11-28 15:34:47 (GMT) |
| commit | 31b798d3c8592c84d36c7c9134a0bcbcb39dd92e (patch) | |
| tree | 87bd63049b10be3c646131d626c417736caf2cae /Lib/py_compile.py | |
| parent | d1b097f8844d5e711c55874baba45b792cf46055 (diff) | |
| parent | 22b9b379159f953ad4805980644414354030624f (diff) | |
| download | cpython-31b798d3c8592c84d36c7c9134a0bcbcb39dd92e.zip cpython-31b798d3c8592c84d36c7c9134a0bcbcb39dd92e.tar.gz cpython-31b798d3c8592c84d36c7c9134a0bcbcb39dd92e.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 |
