diff options
authorTzu Hsiang Lin <>2018-05-22 01:56:44 +0800
committerRichard Purdie <>2018-07-02 11:44:05 +0100
commit6aefc8058579459fb8fd26b3bf71efdad82a6a2d (patch)
parent7a9edf12cc741bbebf6cb244ba4cf3213fe0a1fd (diff)
bitbake: 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>". (Bitbake rev: 86a4cc7248afd3e561dc70f3490f45549265470a) Signed-off-by: Tzu Hsiang Lin <> Signed-off-by: Richard Purdie <>
2 files changed, 1 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/ b/bitbake/lib/bb/fetch2/
index 36beab6a5b..3a6573d0b2 100644
--- a/bitbake/lib/bb/fetch2/
+++ b/bitbake/lib/bb/fetch2/
@@ -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):
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/bitbake/lib/bb/fetch2/ b/bitbake/lib/bb/fetch2/
index 73a75fe989..8f241011fb 100644
--- a/bitbake/lib/bb/fetch2/
+++ b/bitbake/lib/bb/fetch2/
@@ -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