mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-118216: Don't consider dotted __future__
imports (#118267)
This commit is contained in:
parent
67bba9dd0f
commit
7c97dc8c95
5 changed files with 26 additions and 2 deletions
|
@ -77,7 +77,7 @@ future_parse(_PyFutureFeatures *ff, mod_ty mod, PyObject *filename)
|
|||
* are another future statement and a doc string.
|
||||
*/
|
||||
|
||||
if (s->kind == ImportFrom_kind) {
|
||||
if (s->kind == ImportFrom_kind && s->v.ImportFrom.level == 0) {
|
||||
identifier modname = s->v.ImportFrom.module;
|
||||
if (modname &&
|
||||
_PyUnicode_EqualToASCIIString(modname, "__future__")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue