diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-17 11:40:01 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-17 11:40:07 +0300 |
commit | aed4adfbe3a591ca4f8e41fb763c9f961bf2e6d5 (patch) | |
tree | 173fac5c6f8fab2c0056d6b4dc8329405f2b682b /lib/bb/utils.py | |
parent | a3637155e829e06bbfe50fb8753de3de7ee8c22e (diff) | |
download | bitbake-contrib-aed4adfbe3a591ca4f8e41fb763c9f961bf2e6d5.tar.gz |
fetch2/utils: Clean up imports
Move various random imports to the start of the modules as cleanup
and avoid an import issue with bb.process on python 2.6.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/utils.py')
-rw-r--r-- | lib/bb/utils.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py index 2e10fc24d..1ecc44a01 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -27,6 +27,10 @@ import bb import bb.msg import multiprocessing import fcntl +import subprocess +import glob +import traceback +import errno from commands import getstatusoutput from contextlib import contextmanager @@ -276,7 +280,6 @@ def better_compile(text, file, realfile, mode = "exec"): def _print_exception(t, value, tb, realfile, text, context): error = [] try: - import traceback exception = traceback.format_exception_only(t, value) error.append('Error executing a python function in %s:\n' % realfile) @@ -565,11 +568,9 @@ def remove(path, recurse=False): if not path: return if recurse: - import subprocess, glob # shutil.rmtree(name) would be ideal but its too slow subprocess.call(['rm', '-rf'] + glob.glob(path)) return - import os, errno, glob for name in glob.glob(path): try: os.unlink(name) |