mirror of
https://github.com/openwrt/packages.git
synced 2025-12-28 10:00:06 +04:00
Merge pull request #7945 from jefferyto/openwrt-18.06-python-lib2to3-pyc-fix
[openwrt-18.06] python/python3: Fix lib2to3 fixes search
This commit is contained in:
@@ -12,7 +12,7 @@ include ../python-version.mk
|
||||
|
||||
PKG_NAME:=python
|
||||
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
|
||||
|
||||
17
lang/python/python/patches/017_lib2to3_fix_pyc_search.patch
Normal file
17
lang/python/python/patches/017_lib2to3_fix_pyc_search.patch
Normal file
@@ -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
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ PYTHON_VERSION:=$(PYTHON3_VERSION)
|
||||
PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
|
||||
|
||||
PKG_NAME:=python3
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
|
||||
|
||||
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
|
||||
|
||||
17
lang/python/python3/patches/017_lib2to3_fix_pyc_search.patch
Normal file
17
lang/python/python3/patches/017_lib2to3_fix_pyc_search.patch
Normal file
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user