Show More
@@ -305,13 +305,13 b' def find_file(obj) -> str:' | |||
|
305 | 305 | fname = None |
|
306 | 306 | try: |
|
307 | 307 | fname = inspect.getabsfile(obj) |
|
308 | except TypeError: | |
|
308 | except (OSError, TypeError): | |
|
309 | 309 | # For an instance, the file that matters is where its class was |
|
310 | 310 | # declared. |
|
311 | 311 | if hasattr(obj, '__class__'): |
|
312 | 312 | try: |
|
313 | 313 | fname = inspect.getabsfile(obj.__class__) |
|
314 | except TypeError: | |
|
314 | except (OSError, TypeError): | |
|
315 | 315 | # Can happen for builtins |
|
316 | 316 | pass |
|
317 | 317 | except: |
General Comments 0
You need to be logged in to leave comments.
Login now