From 4d3a53ff36526669fcde7b64dc947e8d76aba56b Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 17 May 2013 11:40:01 +0300 Subject: 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 --- bitbake/lib/bb/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/bb/utils.py') 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 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) -- cgit v1.2.3-54-g00ecf