From 0a6ad1010c23715cc3187e6fae350c1e695af713 Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan Date: Wed, 19 Oct 2022 16:53:17 +0200 Subject: [PATCH] inference/compiled/subprocess/functions.py: Skip python3.11's frozen imports Bug: https://github.com/davidhalter/jedi/issues/1858 Signed-off-by: Andrew Ammerlaan --- jedi/inference/compiled/subprocess/functions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jedi/inference/compiled/subprocess/functions.py b/jedi/inference/compiled/subprocess/functions.py index 5070c664..bbc14c39 100644 --- a/jedi/inference/compiled/subprocess/functions.py +++ b/jedi/inference/compiled/subprocess/functions.py @@ -151,7 +151,11 @@ def _find_module(string, path=None, full_name=None, is_global_search=True): spec = find_spec(string, p) if spec is not None: + if spec.origin == "frozen": + continue + loader = spec.loader + if loader is None and not spec.has_location: # This is a namespace package. full_name = string if not path else full_name