##// END OF EJS Templates
oinspect.find_file: Additional safety if file cannot be found....
Bradley M. Froehle -
Show More
@@ -249,7 +249,8 b' def find_file(obj):'
249 # get source if obj was decorated with @decorator
249 # get source if obj was decorated with @decorator
250 if hasattr(obj, '__wrapped__'):
250 if hasattr(obj, '__wrapped__'):
251 obj = obj.__wrapped__
251 obj = obj.__wrapped__
252
252
253 fname = None
253 try:
254 try:
254 fname = inspect.getabsfile(obj)
255 fname = inspect.getabsfile(obj)
255 except TypeError:
256 except TypeError:
@@ -260,9 +261,9 b' def find_file(obj):'
260 fname = inspect.getabsfile(obj.__class__)
261 fname = inspect.getabsfile(obj.__class__)
261 except TypeError:
262 except TypeError:
262 # Can happen for builtins
263 # Can happen for builtins
263 fname = None
264 pass
264 except:
265 except:
265 fname = None
266 pass
266 return fname
267 return fname
267
268
268
269
General Comments 0
You need to be logged in to leave comments. Login now