diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-04-09 13:25:58 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:31 +0100 |
commit | 21a9692c7daf1498f862f5dbe1b85201df39baa7 (patch) | |
tree | 8856ce289b3116a843a8fe949d63213b77f3955f | |
parent | 8c5108fa21da80e30c623732a2c8ca83639488c4 (diff) | |
download | openembedded-core-21a9692c7daf1498f862f5dbe1b85201df39baa7.tar.gz openembedded-core-21a9692c7daf1498f862f5dbe1b85201df39baa7.tar.bz2 openembedded-core-21a9692c7daf1498f862f5dbe1b85201df39baa7.tar.xz openembedded-core-21a9692c7daf1498f862f5dbe1b85201df39baa7.zip |
Use __import__ for the ui rather than exec
(Bitbake rev: 7d00bab300961431f9960cf6759966f608580bc0)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rwxr-xr-x | bitbake/bin/bitbake | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index cef59c911..c2088d932 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake @@ -181,12 +181,12 @@ Default BBFILES are the .bb files in the current directory.""" ) ui = "knotty" try: - # Dynamically load the UI based on the ui name. Although we - # suggest a fixed set this allows you to have flexibility in which - # ones are available. - exec "from bb.ui import " + ui - exec "return_value = " + ui + ".init(serverConnection.connection, serverConnection.events)" - except ImportError: + # Dynamically load the UI based on the ui name. Although we + # suggest a fixed set this allows you to have flexibility in which + # ones are available. + uimodule = __import__("bb.ui", fromlist=[ui]) + return_value = getattr(uimodule, ui).init(serverConnection.connection, serverConnection.events) + except AttributeError: print "FATAL: Invalid user interface '%s' specified. " % ui print "Valid interfaces are 'ncurses', 'depexp' or the default, 'knotty'." except Exception, e: |