<div dir="ltr">subprocess searches PATH by default, /usr/bin/env is redundant anywhere but in a #! line of an executable script, as far as I know.<br></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 25, 2018 at 5:27 PM Changhyeok Bae &lt;<a href="mailto:changhyeok.bae@gmail.com">changhyeok.bae@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Tzu Hsiang Lin &lt;<a href="mailto:t9360341@ntut.org.tw" target="_blank">t9360341@ntut.org.tw</a>&gt;<br>
<br>
When running bitbake command with Python 3.6.5 always result in<br>
import error causing by the change of distutils module.<br>
This patch replaces the method to search executable in PATH by<br>
&quot;/usr/bin/env &lt;command&gt;&quot;.<br>
<br>
Signed-off-by: Tzu Hsiang Lin &lt;<a href="mailto:t9360341@ntut.org.tw" target="_blank">t9360341@ntut.org.tw</a>&gt;<br>
Signed-off-by: Richard Purdie &lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>&gt;<br>
Signed-off-by: Changhyeok Bae &lt;<a href="mailto:changhyeok.bae@gmail.com" target="_blank">changhyeok.bae@gmail.com</a>&gt;<br>
---<br>
 lib/bb/fetch2/clearcase.py | 3 +--<br>
 lib/bb/fetch2/npm.py       | 1 -<br>
 2 files changed, 1 insertion(+), 3 deletions(-)<br>
<br>
diff --git a/lib/bb/fetch2/clearcase.py b/lib/bb/fetch2/clearcase.py<br>
index 70e280a..41cd46f 100644<br>
--- a/lib/bb/fetch2/clearcase.py<br>
+++ b/lib/bb/fetch2/clearcase.py<br>
@@ -70,7 +70,6 @@ from   bb.fetch2 import FetchMethod<br>
 from   bb.fetch2 import FetchError<br>
 from   bb.fetch2 import runfetchcmd<br>
 from   bb.fetch2 import logger<br>
-from   distutils import spawn<br>
<br>
 class ClearCase(FetchMethod):<br>
     &quot;&quot;&quot;Class to fetch urls via &#39;clearcase&#39;&quot;&quot;&quot;<br>
@@ -108,7 +107,7 @@ class ClearCase(FetchMethod):<br>
         else:<br>
             ud.module = &quot;&quot;<br>
<br>
-        ud.basecmd = d.getVar(&quot;FETCHCMD_ccrc&quot;, True) or spawn.find_executable(&quot;cleartool&quot;) or spawn.find_executable(&quot;rcleartool&quot;)<br>
+        ud.basecmd = d.getVar(&quot;FETCHCMD_ccrc&quot;, True) or &quot;/usr/bin/env cleartool || rcleartool&quot;<br>
<br>
         if data.getVar(&quot;SRCREV&quot;, d, True) == &quot;INVALID&quot;:<br>
           raise FetchError(&quot;Set a valid SRCREV for the clearcase fetcher in your recipe, e.g. SRCREV = \&quot;/main/LATEST\&quot; or any other label of your choice.&quot;)<br>
diff --git a/lib/bb/fetch2/npm.py b/lib/bb/fetch2/npm.py<br>
index 699ae72..7ccaba9 100644<br>
--- a/lib/bb/fetch2/npm.py<br>
+++ b/lib/bb/fetch2/npm.py<br>
@@ -33,7 +33,6 @@ from   bb.fetch2 import runfetchcmd<br>
 from   bb.fetch2 import logger<br>
 from   bb.fetch2 import UnpackError<br>
 from   bb.fetch2 import ParameterError<br>
-from   distutils import spawn<br>
<br>
 def subprocess_setup():<br>
     # Python installs a SIGPIPE handler by default. This is usually not what<br>
-- <br>
2.7.4<br>
<br>
-- <br>
_______________________________________________<br>
bitbake-devel mailing list<br>
<a href="mailto:bitbake-devel@lists.openembedded.org" target="_blank">bitbake-devel@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/bitbake-devel" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/bitbake-devel</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Christopher Larson<br>kergoth at gmail dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Senior Software Engineer, Mentor Graphics</div></div></div></div>