aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTzu Hsiang Lin <t9360341@ntut.org.tw>2018-05-22 01:56:44 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-02 11:43:23 +0100
commiteb3bdcc9e7cb273de4114367887d1d7df9f036b7 (patch)
tree6a273b22251c3c21f5f18fb872769e1e449c4942
parent6a9d86998fdd42b13690f024af33b6bf36b9d028 (diff)
downloadbitbake-contrib-eb3bdcc9e7cb273de4114367887d1d7df9f036b7.tar.gz
fetch2: fix import error for Python 3.6.5
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 <t9360341@ntut.org.tw> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/clearcase.py3
-rw-r--r--lib/bb/fetch2/npm.py1
2 files changed, 1 insertions, 3 deletions
diff --git a/lib/bb/fetch2/clearcase.py b/lib/bb/fetch2/clearcase.py
index 36beab6a5..3a6573d0b 100644
--- a/lib/bb/fetch2/clearcase.py
+++ b/lib/bb/fetch2/clearcase.py
@@ -69,7 +69,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'"""
@@ -107,7 +106,7 @@ class ClearCase(FetchMethod):
else:
ud.module = ""
- ud.basecmd = d.getVar("FETCHCMD_ccrc") or spawn.find_executable("cleartool") or spawn.find_executable("rcleartool")
+ ud.basecmd = d.getVar("FETCHCMD_ccrc") or "/usr/bin/env cleartool || rcleartool"
if d.getVar("SRCREV") == "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.")
diff --git a/lib/bb/fetch2/npm.py b/lib/bb/fetch2/npm.py
index 730c346a9..408dfc3d0 100644
--- a/lib/bb/fetch2/npm.py
+++ b/lib/bb/fetch2/npm.py
@@ -32,7 +32,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