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