You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
I attached a patch which changes the code to catch potential SyntaxError exceptions and change them to an ImportError.
I would recommend that you base your patch on the default branch, i.e. what will become Python 3.4. If we judge that this is not a new feature but actually a bug fix, the core developer who commits the patch will take care of backporting it to 2.7 and 3.3.
Fixed for Python 3.8 via the patch for bpo-35936. We won't be backporting that patch as it also migrates modulefinder from the deprecated imp API to support importlib one, and is hence considered overly intrusive for a bug fix release.