Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make stubgen not crash on sqlalchemy #3046

Merged
merged 2 commits into from
Mar 24, 2017
Merged

Conversation

JelleZijlstra
Copy link
Member

A few modules in sqlalchemy don't react kindly to being imported, and some
more don't like being reloaded. I don't see why stubgen needs to reload
modules, so I removed the reload. I'm just ignoring modules that don't
import.

This helps address python/typeshed#974.

A few modules in sqlalchemy don't react kindly to being imported, and some
more don't like being reloaded. I don't see why stubgen needs to reload
modules, so I removed the reload. I'm just ignoring modules that don't
import.
@gvanrossum gvanrossum requested a review from JukkaL March 23, 2017 15:14
search_path=search_path,
interpreter=interpreter)
except CantImport:
if not quiet:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to display error messages even in quiet mode.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it print the error message either way. I noticed though that quiet mode is unused; it defaults to False and nothing outside of tests calls generate_stub_for_module with quiet=True.

@JukkaL
Copy link
Collaborator

JukkaL commented Mar 24, 2017

Thanks! LGTM. Not sure why I did the module reload -- maybe it was for interactive use or for tests. We'll see if removing it causes some trouble.

@JukkaL JukkaL merged commit 3e5aeb8 into python:master Mar 24, 2017
@JelleZijlstra JelleZijlstra deleted the stubgensql branch March 24, 2017 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants