Skip to content

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.

3 participants