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

In Express, set session to None when importing shared #1082

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wch
Copy link
Collaborator

@wch wch commented Jan 27, 2024

This is one possible solution for #1079.

When it sees import shared or from shared import ... at the top level, it puts that within a with session_context(None): block.

One possible limitation is that, if someone does this:

import module1, shared

Then that gets transformed into

with session_context(None):
    import module1, shared

which means that module1 would also have the session set to None. In practice, it seems unusual for people to put multiple imports on a line like that, but still, it could happen.

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.

None yet

1 participant