This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jgosmann
Recipients jgosmann
Date 2013-03-11.12:03:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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_
    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:45jgosmannsetrecipients: + jgosmann
2013-03-11 12:03:45jgosmannsetmessageid: <>
2013-03-11 12:03:45jgosmannlinkissue17396 messages
2013-03-11 12:03:45jgosmanncreate