Fix for #88 - written by proti:
authorMarcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Thu, 30 Jun 2005 09:44:36 +0000 (09:44 +0000)
committerMarcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Thu, 30 Jun 2005 09:44:36 +0000 (09:44 +0000)
The function should be shielded against the posibility that prevdir could be removed by the function.

lib/bb/build.py

index dd8b5e1..599b45d 100644 (file)
@@ -114,7 +114,9 @@ def exec_func(func, d, dirs = None):
         exec_func_python(func, d)
     else:
         exec_func_shell(func, d)
-    os.chdir(prevdir)
+
+    if os.path.exists(prevdir):
+        os.chdir(prevdir)
 
 def exec_func_python(func, d):
     """Execute a python BB 'function'"""