Message183953
Running modulefinder.ModuleFinder.run_script on a script which has an import statement with a module containing a syntax error will raise a SyntaxError exception. I think, modulefinder should instead continue its analysis and add the module to badmodules. Especially, as there are valid reasons for importing modules with syntax errors like in the following code snippet
if not python3:
from .exec_py2 import exec_
else:
from .exec_py3 import exec_
I attached a patch which changes the code to catch potential SyntaxError exceptions and change them to an ImportError. |
|
Date |
User |
Action |
Args |
2013-03-11 12:03:45 | jgosmann | set | recipients:
+ jgosmann |
2013-03-11 12:03:45 | jgosmann | set | messageid: <1363003425.82.0.865184669213.issue17396@psf.upfronthosting.co.za> |
2013-03-11 12:03:45 | jgosmann | link | issue17396 messages |
2013-03-11 12:03:45 | jgosmann | create | |
|