diff options
Diffstat (limited to 'Lib/compileall.py')
| -rw-r--r-- | Lib/compileall.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/compileall.py b/Lib/compileall.py index be9e2ad05f..ea2ee7fbb6 100644 --- a/Lib/compileall.py +++ b/Lib/compileall.py @@ -91,13 +91,14 @@ def compile_file(fullname, ddir=None, force=0, rx=None, quiet=False, else: cfile = imp.cache_from_source(fullname) cache_dir = os.path.dirname(cfile) - try: - os.mkdir(cache_dir) - except OSError as error: - if error.errno != errno.EEXIST: - raise head, tail = name[:-3], name[-3:] if tail == '.py': + if not legacy: + try: + os.mkdir(cache_dir) + except OSError as error: + if error.errno != errno.EEXIST: + raise if not force: try: mtime = int(os.stat(fullname).st_mtime) |
