8000 gh-125331: Allow the parser to activate future imports on the fly by pablogsal · Pull Request #125482 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-125331: Allow the parser to activate future imports on the fly #125482

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

Merged
merged 10 commits into from
Feb 14, 2025
Prev Previous commit
Next Next commit
Update action_helpers.c
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
  • Loading branch information
pablogsal and nineteendo committed Feb 13, 2025
commit f3772917d5b2b9fad77ff51d3e9cb1c1d9a47e91
2 changes: 1 addition & 1 deletion Parser/action_helpers.c
8980
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,7 @@ stmt_ty
_PyPegen_checked_future_import(Parser *p, identifier module, asdl_alias_seq * names, int level,
int lineno, int col_offset, int end_lineno, int end_col_offset,
PyArena *arena) {
if (PyUnicode_CompareWithASCIIString(module, "__future__") == 0) {
if (level == 0 && PyUnicode_CompareWithASCIIString(module, "__future__") == 0) {
for (Py_ssize_t i = 0; i < asdl_seq_LEN(names); i++) {
alias_ty alias = asdl_seq_GET(names, i);
if (PyUnicode_CompareWithASCIIString(alias->name, "barry_as_FLUFL") == 0) {
Expand Down
0