Browse Source

Update compileall.py

blueloveTH 4 months ago
parent
commit
3c379402c8
1 changed files with 2 additions and 0 deletions
  1. 2 0
      compileall.py

+ 2 - 0
compileall.py

@@ -16,6 +16,8 @@ def do_compile(src_path, dst_path):
     assert os.system(cmd) == 0
     assert os.system(cmd) == 0
 
 
 if os.path.isfile(source_dir):
 if os.path.isfile(source_dir):
+    if output_dir.endswith('.py'):
+        output_dir += 'c'
     do_compile(source_dir, output_dir)
     do_compile(source_dir, output_dir)
     exit(0)
     exit(0)