Files
RustPython/Lib/test/test_import
youknowdot 7f5cc0e35c Align import, numeric and warning edge cases with Python 3.15 (#9210)
* Align import, numeric and warning edge cases with Python 3.15

Carry four independent compatibility fixes from the 3.15 upgrade: preserve import cache lookup errors, handle surrogate module names, qualify numeric conversion diagnostics, and accept frozen warning globals. Match pinned CPython d220409a13b77de7a6c30abe16ea90db01528edc.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve the integer contract of builtin module detection

Return -1 for the separately initialized sys/builtins core modules, 1 for registered definitions and 0 for absent or unencodable names, matching pinned CPython import.c and its initialization table.

Assisted-by: OpenAI Codex:model version unavailable

* Normalize successful index conversions to exact integers

Match PyNumber_Index after its internal protocol call: preserve exceptions and warning timing, then copy bool or int-subclass payloads to an exact int without calling __index__ again.

Assisted-by: OpenAI Codex:model version unavailable

* Retire passing surrogate-import expected failures

Canonical cases now pass on the repaired import paths, including hosted Windows validation. Preserve their bodies and platform guards through update_lib.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-19 20:34:04 +09:00
..
2023-03-01 18:06:50 +09:00