|
6 | 6 |
|
7 | 7 | from __future__ import annotations
|
8 | 8 |
|
| 9 | +import sys |
9 | 10 | import textwrap
|
10 | 11 | import unittest
|
11 | 12 | from abc import ABCMeta
|
|
32 | 33 | from astroid.arguments import CallSite
|
33 | 34 | from astroid.bases import BoundMethod, Instance, UnboundMethod, UnionType
|
34 | 35 | from astroid.builder import AstroidBuilder, _extract_single_node, extract_node, parse
|
35 |
| -from astroid.const import IS_PYPY, PY39_PLUS, PY310_PLUS |
| 36 | +from astroid.const import IS_PYPY, PY39_PLUS, PY310_PLUS, PY312_PLUS |
36 | 37 | from astroid.context import CallContext, InferenceContext
|
37 | 38 | from astroid.exceptions import (
|
38 | 39 | AstroidTypeError,
|
@@ -988,7 +989,12 @@ def test_import_as(self) -> None:
|
988 | 989 | self.assertIsInstance(inferred[0], nodes.Module)
|
989 | 990 | self.assertEqual(inferred[0].name, "os.path")
|
990 | 991 | inferred = list(ast.igetattr("e"))
|
991 |
| - self.assertEqual(len(inferred), 1) |
| 992 | + if PY312_PLUS and sys.platform.startswith("win"): |
| 993 | + # There are two os.path.exists exported, likely due to |
| 994 | + # https://github.com/python/cpython/pull/101324 |
| 995 | + self.assertEqual(len(inferred), 2) |
| 996 | + else: |
| 997 | + self.assertEqual(len(inferred), 1) |
992 | 998 | self.assertIsInstance(inferred[0], nodes.FunctionDef)
|
993 | 999 | self.assertEqual(inferred[0].name, "exists")
|
994 | 1000 |
|
|
0 commit comments