summaryrefslogtreecommitdiffstats
path: root/Lib/py_compile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/py_compile.py')
-rw-r--r--Lib/py_compile.py4
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