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):