[1.32] fetch2: fix import error for Python 3.6.5
PATCH v2 1/1 [1.32] fetch2: fix import error for Python 3.6.5
From: Tzu Hsiang Lin <[email protected]>
When running bitbake command with Python 3.6.5 always result in import error causing by the change of distutils module. This patch replaces the method to search executable in PATH by "/usr/bin/env <command>".
--- lib/bb/fetch2/clearcase.py | 3 +-- lib/bb/fetch2/npm.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-)
lib/bb/fetch2/clearcase.py +1 -2
@@ -70,7 +70,6 @@ from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import runfetchcmd from bb.fetch2 import logger -from distutils import spawn class ClearCase(FetchMethod): """Class to fetch urls via 'clearcase'"""
@@ -108,7 +107,7 @@ class ClearCase(FetchMethod): else: ud.module = "" - ud.basecmd = d.getVar("FETCHCMD_ccrc", True) or spawn.find_executable("cleartool") or spawn.find_executable("rcleartool") + ud.basecmd = d.getVar("FETCHCMD_ccrc", True) or "/usr/bin/env cleartool || rcleartool" if data.getVar("SRCREV", d, True) == "INVALID": raise FetchError("Set a valid SRCREV for the clearcase fetcher in your recipe, e.g. SRCREV = \"/main/LATEST\" or any other label of your choice.")
lib/bb/fetch2/npm.py +0 -1
@@ -33,7 +33,6 @@ from bb.fetch2 import runfetchcmd from bb.fetch2 import logger from bb.fetch2 import UnpackError from bb.fetch2 import ParameterError -from distutils import spawn def subprocess_setup(): # Python installs a SIGPIPE handler by default. This is usually not what
Signature · 1 line
2.7.4
subprocess searches PATH by default, /usr/bin/env is redundant anywhere but in a #! line of an executable script, as far as I know.
Quoted 62 lines · Changhyeok Bae
From: Tzu Hsiang Lin <[email protected]>
When running bitbake command with Python 3.6.5 always result in import error causing by the change of distutils module. This patch replaces the method to search executable in PATH by "
/usr/bin/env<command>".Signed-off-by Tzu Hsiang Lin <[email protected]>Signed-off-by Richard Purdie <[email protected]>Signed-off-by Changhyeok Bae <[email protected]>--- lib/bb/fetch2/clearcase.py | 3 +-- lib/bb/fetch2/npm.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-)lib/bb/fetch2/clearcase.py +1
-2@@ -70,7 +70,6 @@ from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import runfetchcmd from bb.fetch2 import logger -from distutils import spawn class ClearCase(FetchMethod): """Class to fetch urls via 'clearcase'"""@@ -108,7 +107,7 @@ class ClearCase(FetchMethod): else: ud.module = "" - ud.basecmd = d.getVar("FETCHCMD_ccrc", True) or spawn.find_executable("cleartool") or spawn.find_executable("rcleartool") + ud.basecmd = d.getVar("FETCHCMD_ccrc", True) or "/usr/bin/envcleartool || rcleartool"
if
data.getVar("SRCREV", d, True)== "INVALID":
raise FetchError("Set a valid SRCREV for the clearcase fetcher
in your recipe, e.g. SRCREV = \"/main/LATEST\" or any other label of your choice.")lib/bb/fetch2/npm.py +0
-1@@ -33,7 +33,6 @@ from bb.fetch2 import runfetchcmd from bb.fetch2 import logger from bb.fetch2 import UnpackError from bb.fetch2 import ParameterError -from distutils import spawn def subprocess_setup(): # Python installs a SIGPIPE handler by default. This is usually notwhat
--
2.7.4--
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel
Signature · 4 lines
Christopher Larson kergoth at gmail dot com Founder - BitBake, OpenEmbedded, OpenZaurus Senior Software Engineer, Mentor Graphics
Chris: you're right, but it was already merged in this form to master, 1.38, 1.36, 1.34 branches, so it would be better to keep the same for 1.32.
Quoted 81 lines · Christopher Larson
subprocess searches PATH by default,
/usr/bin/envis redundant anywhere but in a #! line of an executable script, as far as I know.Quoted 56 lines · Changhyeok Bae
From: Tzu Hsiang Lin <[email protected]>
When running bitbake command with Python 3.6.5 always result in import error causing by the change of distutils module. This patch replaces the method to search executable in PATH by "
/usr/bin/env<command>".Signed-off-by Tzu Hsiang Lin <[email protected]>Signed-off-by Richard Purdie <[email protected]>Signed-off-by Changhyeok Bae <[email protected]>--- lib/bb/fetch2/clearcase.py | 3 +-- lib/bb/fetch2/npm.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-)lib/bb/fetch2/clearcase.py +1
-2@@ -70,7 +70,6 @@ from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import runfetchcmd from bb.fetch2 import logger -from distutils import spawn class ClearCase(FetchMethod): """Class to fetch urls via 'clearcase'"""@@ -108,7 +107,7 @@ class ClearCase(FetchMethod): else: ud.module = "" - ud.basecmd = d.getVar("FETCHCMD_ccrc", True) or spawn.find_executable("cleartool") or spawn.find_executable("rcleartool") + ud.basecmd = d.getVar("FETCHCMD_ccrc", True) or "/usr/bin/envcleartool || rcleartool"
if
data.getVar("SRCREV", d, True)== "INVALID":
raise FetchError("Set a valid SRCREV for the clearcase fetcher
in your recipe, e.g. SRCREV = \"/main/LATEST\" or any other label of your choice.")lib/bb/fetch2/npm.py +0
-1@@ -33,7 +33,6 @@ from bb.fetch2 import runfetchcmd from bb.fetch2 import logger from bb.fetch2 import UnpackError from bb.fetch2 import ParameterError -from distutils import spawn def subprocess_setup(): # Python installs a SIGPIPE handler by default. This is usually notwhat
--
2.7.4Quoted 6 lines
--
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel--
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics
--
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel
Quoted 3 lines · Martin Jansa
Chris: you're right, but it was already merged in this form to master, 1.38, 1.36, 1.34 branches, so it would be better to keep the same for 1.32.
Agreed, we should have made a better patch and we should really improve master...
Cheers,
Richard