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

FIX: in py3.13 exec does not implicitly update locals() #8057

Closed
wants to merge 1 commit into from

Conversation

tacaswell
Copy link
Contributor

@tacaswell tacaswell commented May 13, 2024

Alternative to #8050

exec(compile(f.read(), version_file, "exec"))
return locals()["__version__"]
lcl = {}
exec(compile(f.read(), version_file, "exec"), lcl)
Copy link
Member

Choose a reason for hiding this comment

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

lcl is the second argument to exec(). Looking at https://docs.python.org/3.13/library/functions.html#exec, this would be globals, right? So maybe lcl is a confusing name, because it makes one think that locals is being used instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, yes it should have been second (I like the new ability to pass them as kwargs :) )

@hugovk
Copy link
Member

hugovk commented May 21, 2024

We went for #8050, thanks anyway for the PR.

@hugovk hugovk closed this May 21, 2024
@tacaswell tacaswell deleted the fix/exec_in_steup.py branch May 21, 2024 17:17
@tacaswell tacaswell restored the fix/exec_in_steup.py branch May 21, 2024 19:07
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

3 participants