summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorJuro Bystricky <juro.bystricky@intel.com>2016-09-26 13:53:13 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-28 10:17:13 +0100
commit8b24b0c3593de2d8ada977cd4a49229771a6c477 (patch)
tree6622dad8467000a7e382ff681c28c40d9e895600 /bitbake/lib/bb
parent12905346a08c58ee8dba33a6cbcd098149803540 (diff)
downloadpoky-8b24b0c3593de2d8ada977cd4a49229771a6c477.tar.gz
bitbake: build.py: fix os.getcwd() exception
When trying to obtain the current directory from a directory that does not exist anymore, an exception is raised. This patch handles such exception. [YOCTO #10331] (Bitbake rev: 4bcf77589312d9936340d8c308006c2fc9baf67c) Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/build.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 2ed0441b49..249f7d6bb4 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -261,9 +261,14 @@ def exec_func(func, d, dirs = None, pythonexception=False):
261 else: 261 else:
262 exec_func_shell(func, d, runfile, cwd=adir) 262 exec_func_shell(func, d, runfile, cwd=adir)
263 263
264 if oldcwd and os.getcwd() != oldcwd: 264 try:
265 curcwd = os.getcwd()
266 except:
267 curcwd = None
268
269 if oldcwd and curcwd != oldcwd:
265 try: 270 try:
266 bb.warn("Task %s changed cwd to %s" % (func, os.getcwd())) 271 bb.warn("Task %s changed cwd to %s" % (func, curcwd))
267 os.chdir(oldcwd) 272 os.chdir(oldcwd)
268 except: 273 except:
269 pass 274 pass