Comment 0 for bug 245514

Revision history for this message
Eleanor Berger (intellectronica) wrote : lint should recognize (and not warn about) try...except imports of modules

Occasionally we want to import a module, but only if the import of another module fails, using the same name. For example, this is a popular idiom when importing a module which has a native code version which is only available on some tergets:

try:
  from themodule import TheClass
except:
  from cThemodule import cTheClass as TheClass

Currently, lint warns about such cases, but it should be possible to recognize that this is valid, and not warn.