summaryrefslogtreecommitdiffstats
path: root/Python/future.c
diff options
context:
space:
mode:
authorCrowthebird <78076854+thatbirdguythatuknownot@users.noreply.github.com>2024-05-02 13:32:20 (GMT)
committerGitHub <noreply@github.com>2024-05-02 13:32:20 (GMT)
commit7c97dc8c9594c71bd3d1f69758a27de45f57e4c3 (patch)
tree480d75833e594394bccb168b6b8d86c131d0d65a /Python/future.c
parent67bba9dd0f5b9c2d24c2bc6d239c4502040484af (diff)
downloadcpython-7c97dc8c9594c71bd3d1f69758a27de45f57e4c3.zip
cpython-7c97dc8c9594c71bd3d1f69758a27de45f57e4c3.tar.gz
cpython-7c97dc8c9594c71bd3d1f69758a27de45f57e4c3.tar.bz2
gh-118216: Don't consider dotted `__future__` imports (#118267)
Diffstat (limited to 'Python/future.c')
-rw-r--r--Python/future.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/future.c b/Python/future.c
index 399345b..8d94d51 100644
--- a/Python/future.c
+++ b/Python/future.c
@@ -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__")) {