diff options
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r-- | bitbake/lib/bb/utils.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 2e10fc24dd..1ecc44a01a 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -27,6 +27,10 @@ import bb | |||
27 | import bb.msg | 27 | import bb.msg |
28 | import multiprocessing | 28 | import multiprocessing |
29 | import fcntl | 29 | import fcntl |
30 | import subprocess | ||
31 | import glob | ||
32 | import traceback | ||
33 | import errno | ||
30 | from commands import getstatusoutput | 34 | from commands import getstatusoutput |
31 | from contextlib import contextmanager | 35 | from contextlib import contextmanager |
32 | 36 | ||
@@ -276,7 +280,6 @@ def better_compile(text, file, realfile, mode = "exec"): | |||
276 | def _print_exception(t, value, tb, realfile, text, context): | 280 | def _print_exception(t, value, tb, realfile, text, context): |
277 | error = [] | 281 | error = [] |
278 | try: | 282 | try: |
279 | import traceback | ||
280 | exception = traceback.format_exception_only(t, value) | 283 | exception = traceback.format_exception_only(t, value) |
281 | error.append('Error executing a python function in %s:\n' % realfile) | 284 | error.append('Error executing a python function in %s:\n' % realfile) |
282 | 285 | ||
@@ -565,11 +568,9 @@ def remove(path, recurse=False): | |||
565 | if not path: | 568 | if not path: |
566 | return | 569 | return |
567 | if recurse: | 570 | if recurse: |
568 | import subprocess, glob | ||
569 | # shutil.rmtree(name) would be ideal but its too slow | 571 | # shutil.rmtree(name) would be ideal but its too slow |
570 | subprocess.call(['rm', '-rf'] + glob.glob(path)) | 572 | subprocess.call(['rm', '-rf'] + glob.glob(path)) |
571 | return | 573 | return |
572 | import os, errno, glob | ||
573 | for name in glob.glob(path): | 574 | for name in glob.glob(path): |
574 | try: | 575 | try: |
575 | os.unlink(name) | 576 | os.unlink(name) |