summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-17 11:40:01 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-17 12:42:08 +0300
commit4d3a53ff36526669fcde7b64dc947e8d76aba56b (patch)
tree659ef2923ef2123a008394fefc066cc69585aaa0 /bitbake/lib/bb/utils.py
parent0a52bdfb9a63a0cc5654406f98b5bbcd2de3aad8 (diff)
downloadpoky-4d3a53ff36526669fcde7b64dc947e8d76aba56b.tar.gz
bitbake: 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. (Bitbake rev: aed4adfbe3a591ca4f8e41fb763c9f961bf2e6d5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py7
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
27import bb.msg 27import bb.msg
28import multiprocessing 28import multiprocessing
29import fcntl 29import fcntl
30import subprocess
31import glob
32import traceback
33import errno
30from commands import getstatusoutput 34from commands import getstatusoutput
31from contextlib import contextmanager 35from contextlib import contextmanager
32 36
@@ -276,7 +280,6 @@ def better_compile(text, file, realfile, mode = "exec"):
276def _print_exception(t, value, tb, realfile, text, context): 280def _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)