diff options
Diffstat (limited to 'Lib/py_compile.py')
-rw-r--r-- | Lib/py_compile.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/py_compile.py b/Lib/py_compile.py index 03f2c62..111893e 100644 --- a/Lib/py_compile.py +++ b/Lib/py_compile.py @@ -123,11 +123,11 @@ def compile(file, cfile=None, dfile=None, doraise=False): return if cfile is None: cfile = imp.cache_from_source(file) - try: - os.mkdir(os.path.dirname(cfile)) - except OSError as error: - if error.errno != errno.EEXIST: - raise + try: + os.makedirs(os.path.dirname(cfile)) + except OSError as error: + if error.errno != errno.EEXIST: + raise with open(cfile, 'wb') as fc: fc.write(b'\0\0\0\0') wr_long(fc, timestamp) |