[Buildroot] [git commit] package/python-aenum: fix pyc compilation error

Arnout Vandecappelle (Essensium/Mind) arnout at mind.be
Mon May 2 21:56:31 UTC 2022


commit: https://git.buildroot.net/buildroot/commit/?id=d7db5af34f25cf9f3e8577c75ff290495c5724c6
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

_py2.py uses syntax not compatible with Python3. Remove _py2.py
to avoid the following compilation error:

error:   File "/usr/lib/python3.10/site-packages/aenum/_py2.py", line 5
    raise exc, None, tb
             ^
SyntaxError: invalid syntax

Signed-off-by: Yegor Yefremov <yegorslists at googlemail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be>
---
 package/python-aenum/python-aenum.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/package/python-aenum/python-aenum.mk b/package/python-aenum/python-aenum.mk
index 9a30211bb6..603fc66d0c 100644
--- a/package/python-aenum/python-aenum.mk
+++ b/package/python-aenum/python-aenum.mk
@@ -11,4 +11,12 @@ PYTHON_AENUM_SETUP_TYPE = setuptools
 PYTHON_AENUM_LICENSE = BSD-3-Clause
 PYTHON_AENUM_LICENSE_FILES = aenum/LICENSE
 
+# _py2.py uses syntax not compatible with Python3.
+# Remove _py2.py to avoid compilation error.
+define PYTHON_AENUM_REMOVE_PY2_PY
+	rm $(@D)/aenum/_py2.py
+endef
+
+PYTHON_AENUM_POST_EXTRACT_HOOKS = PYTHON_AENUM_REMOVE_PY2_PY
+
 $(eval $(python-package))



More information about the buildroot mailing list