Handle object with __file__ attribute having a None value (issue #2082)
This commit is contained in:
1 parent
b80c0b8992
commit
a89757a966
1 file changed
+1
-1
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user