8.修改hue的一处代码
修改文件为:hue/desktop/core/src/desktop/appmanager.py
改动其中的import_module_or_none方法为如下,在my_file = re.sub(r'\.pyc','.py', __file__)
语句后面直接return None
def _import_module_or_none(module): """Like import_module, but returns None if the module does not exist. This will properly handle nested ImportErrors in such a way that, if the module should exist but throws ImportError, we *will* raise through that error. """ try:
__import__(module)
return sys.modules[module]
except ImportError, ie:
# If the exception came from us importing, we want to just
# return None. We need to inspect the stack, though, so we properly
# reraise in the case that the module we're importing triggered
# an import error itself.
tb = sys.exc_info()[2]
top_frame = traceback.extract_tb(tb)[-1]
err_file = re.sub(r'\.pyc','.py', top_frame[0])
my_file = re.sub(r'\.pyc','.py', __file__)
return None
不修改的话在eclispe中调试时,会报错"ImportError: No module named settings"