summaryrefslogtreecommitdiff
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 5b3710f84f..40b5f2f3dc 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -582,10 +582,12 @@ def build_environment(d):
def remove(path, recurse=False):
"""Equivalent to rm -f or rm -rf"""
+ if not path:
+ return
import os, errno, shutil
try:
os.unlink(path)
- except OSError, exc:
+ except OSError as exc:
if recurse and exc.errno == errno.EISDIR:
shutil.rmtree(path)
elif exc.errno != errno.ENOENT: