From bc465d83ad8665211b6f9664b418f4eafcc5ca6c Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 16 Nov 2009 10:45:23 +0000 Subject: classes: Drop a number of unneeded import calls (from Poky) Signed-off-by: Richard Purdie --- classes/sanity.bbclass | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'classes/sanity.bbclass') diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass index 83c03299bf..f65df61c1d 100644 --- a/classes/sanity.bbclass +++ b/classes/sanity.bbclass @@ -11,8 +11,6 @@ def raise_sanity_error(msg): %s""" % msg) def check_conf_exists(fn, data): - import bb, os - bbpath = [] fn = bb.data.expand(fn, data) vbbpath = bb.data.getVar("BBPATH", data) @@ -26,12 +24,12 @@ def check_conf_exists(fn, data): def check_sanity(e): from bb import note, error, data, __version__ - from bb.event import Handled, NotHandled, getName + try: from distutils.version import LooseVersion except ImportError: def LooseVersion(v): print "WARNING: sanity.bbclass can't compare versions without python-distutils"; return 1 - import os, commands + import commands # Check the bitbake version meets minimum requirements minversion = data.getVar('BB_MIN_VERSION', e.data , True) @@ -193,10 +191,8 @@ def check_sanity(e): addhandler check_sanity_eventhandler python check_sanity_eventhandler() { - from bb import note, error, data, __version__ - from bb.event import getName - - if getName(e) == "ConfigParsed": + from bb.event import Handled, NotHandled + if bb.event.getName(e) == "ConfigParsed": check_sanity(e) return NotHandled -- cgit 1.2.3-korg