python3's lib2to3 would fail in silence if python3 and its packages are installed as compiled .pyc files. Root cause is, in Lib/lib2to3/refactor.py, the function get_all_fix_names only searches '.py' fix names. Signed-off-by: Nj Hsiong <nj.hsiong@gmail.com>
17 lines
593 B
Diff
17 lines
593 B
Diff
diff --git a/Lib/lib2to3/refactor.py b/Lib/lib2to3/refactor.py
|
|
index 7841b99..1e0d3b3 100644
|
|
--- a/Lib/lib2to3/refactor.py
|
|
+++ b/Lib/lib2to3/refactor.py
|
|
@@ -37,6 +37,12 @@ def get_all_fix_names(fixer_pkg, remove_prefix=True):
|
|
if remove_prefix:
|
|
name = name[4:]
|
|
fix_names.append(name[:-3])
|
|
+ if name.startswith("fix_") and name.endswith(".pyc"):
|
|
+ if remove_prefix:
|
|
+ name = name[4:]
|
|
+ name = name[:-4]
|
|
+ if name not in fix_names:
|
|
+ fix_names.append(name)
|
|
return fix_names
|
|
|
|
|