[oe-commits] [bitbake] branch master-next updated: build.py: fix os.getcwd() exception
git at git.openembedded.org
git at git.openembedded.org
Tue Sep 27 12:27:10 UTC 2016
rpurdie pushed a commit to branch master-next
in repository bitbake.
The following commit(s) were added to refs/heads/master-next by this push:
new 4bcf775 build.py: fix os.getcwd() exception
4bcf775 is described below
commit 4bcf77589312d9936340d8c308006c2fc9baf67c
Author: Juro Bystricky <juro.bystricky at intel.com>
AuthorDate: Mon Sep 26 13:53:13 2016 -0700
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]
Signed-off-by: Juro Bystricky <juro.bystricky at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/build.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/bb/build.py b/lib/bb/build.py
index 2ed0441..249f7d6 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -261,9 +261,14 @@ def exec_func(func, d, dirs = None, pythonexception=False):
else:
exec_func_shell(func, d, runfile, cwd=adir)
- if oldcwd and os.getcwd() != oldcwd:
+ try:
+ curcwd = os.getcwd()
+ except:
+ curcwd = None
+
+ if oldcwd and curcwd != oldcwd:
try:
- bb.warn("Task %s changed cwd to %s" % (func, os.getcwd()))
+ bb.warn("Task %s changed cwd to %s" % (func, curcwd))
os.chdir(oldcwd)
except:
pass
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list