diff options
| author | Hannu Nyman <hannu.nyman@iki.fi> | 2019-01-12 18:28:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-12 18:28:34 +0200 |
| commit | 179b06d76d1c0a0d3cbe60b85565d4e20845f611 (patch) | |
| tree | 1c7d3f47b868c3597feb5c23611b894f4131ab09 /lang/python/python3/patches | |
| parent | 42700544f40491abd05cf4b72b63d8caa44addbd (diff) | |
| parent | c98b12d9a920ede376d1eaef0da0c0da9d26d6b3 (diff) | |
Merge pull request #7931 from kidome/master
python3: enable lib2to3 to also search .pyc files.
Diffstat (limited to 'lang/python/python3/patches')
| -rw-r--r-- | lang/python/python3/patches/017_lib2to3_fix_pyc_search.patch | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lang/python/python3/patches/017_lib2to3_fix_pyc_search.patch b/lang/python/python3/patches/017_lib2to3_fix_pyc_search.patch new file mode 100644 index 000000000..5972914bd --- /dev/null +++ b/lang/python/python3/patches/017_lib2to3_fix_pyc_search.patch @@ -0,0 +1,17 @@ +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 + + |
