From a89757a9667bd000356487b66224578bb7470573 Mon Sep 17 00:00:00 2001 From: Mark Diekhans Date: Sat, 20 Dec 2025 17:24:25 -0800 Subject: [PATCH] Handle object with __file__ attribute having a None value (issue #2082) --- jedi/inference/compiled/access.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jedi/inference/compiled/access.py b/jedi/inference/compiled/access.py index 09ed1b64..5a8e68fa 100644 --- a/jedi/inference/compiled/access.py +++ b/jedi/inference/compiled/access.py @@ -184,7 +184,7 @@ class DirectObjectAccess: def py__file__(self) -> Optional[Path]: try: return Path(self._obj.__file__) - except AttributeError: + except (AttributeError, TypeError): return None def py__doc__(self):