diff --git a/python/extractor/imp.py b/python/extractor/imp.py index 8d703250b67..5130f64ebef 100644 --- a/python/extractor/imp.py +++ b/python/extractor/imp.py @@ -25,7 +25,7 @@ try: from importlib._bootstrap import _ERR_MSG except ImportError: from importlib._bootstrap import _ERR_MSG_PREFIX - _ERR_MSG = _ERR_MSG_PREFIX + '{name!r}' + _ERR_MSG = _ERR_MSG_PREFIX + '{!r}' from importlib import machinery from importlib import util diff --git a/python/extractor/semmle/util.py b/python/extractor/semmle/util.py index 2f6a18ac7a9..445d40dab3d 100644 --- a/python/extractor/semmle/util.py +++ b/python/extractor/semmle/util.py @@ -10,7 +10,7 @@ from io import BytesIO #Semantic version of extractor. #Update this if any changes are made -VERSION = "7.1.5" +VERSION = "7.1.6" PY_EXTENSIONS = ".py", ".pyw" diff --git a/python/ql/lib/change-notes/2025-11-27-fix-keyerror-in-imp-module.md b/python/ql/lib/change-notes/2025-11-27-fix-keyerror-in-imp-module.md new file mode 100644 index 00000000000..8494331ef3b --- /dev/null +++ b/python/ql/lib/change-notes/2025-11-27-fix-keyerror-in-imp-module.md @@ -0,0 +1,5 @@ +--- +category: fix +--- + +- Fixed a bug in the Python extractor's import handling where failing to find an import in `find_module` would cause a `KeyError` to be raised. (Contributed by @akoeplinger.)