Package: src:astroid
Version: 4.1.1-2
User: [email protected]
Usertags: python3.15
Tags: patch, forky, sid
Hi!
While rebuilding the python related packages against the Python 3.15rc1
version we found that astroid has a change in behavior that causes other
packages to fail to build [1].
This was already found and fixed upstream with a patch that catches the
ModuleNotFoundError that is generated when running with Python 3.15. [2]
I applied the upstream fix in the sandbox [3] to be able to build the
packages that depend on astroid, please consider applying the patch to
support the upcoming 3.15 version.
Happy hacking,
[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4493763/
[2]:
https://github.com/pylint-dev/astroid/commit/7fe3057bc2864ccf18c524b5e85fe57a12f32ef6
[3]: https://debusine.debian.net/debian/r-python-python3.15/
--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
commit 7fe3057bc2864ccf18c524b5e85fe57a12f32ef6
Author: Jacob Walls <[email protected]>
Date: Fri Apr 24 06:30:50 2026 -0400
Cope with Python 3.15 change for ModuleNotFoundError (#3035)
Index: astroid/astroid/interpreter/_import/util.py
===================================================================
--- astroid.orig/astroid/interpreter/_import/util.py
+++ astroid/astroid/interpreter/_import/util.py
@@ -72,10 +72,10 @@ def is_namespace(modname: str) -> bool:
# Workaround for "py" module
# https://github.com/pytest-dev/apipkg/issues/13
return False
- except KeyError:
- # Intermediate steps might raise KeyErrors
- # https://github.com/python/cpython/issues/93334
- # TODO: update if fixed in importlib
+ # PY314: When dropping support for 3.14, replace with just
+ # except ModuleNotFoundError:
+ except (KeyError, ModuleNotFoundError):
+ # Intermediate steps might raise ModuleNotFoundError
# For tree a > b > c.py
# >>> from importlib.machinery import PathFinder
# >>> PathFinder.find_spec('a.b', ['a'])