[imp] use imp.find_module instead of exec('import %s')

bzr revid: xmo@tinyerp.com-20091212160004-0u8m6v9w3o9p97hp
This commit is contained in:
Xavier Morel 2009-12-12 17:00:04 +01:00
parent 5f2c53c0af
commit 7daf1bc09a
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ def check_modules():
ok = True
for modname, desc in required_modules:
try:
exec('import %s' % modname)
imp.find_module(modname)
except ImportError:
ok = False
print 'Error: python module %s (%s) is required' % (modname, desc)