Fix `get_call_location` by increasing frame offset.
This is to offset the call to `get_call_location` itself.
@@ -52,8 +52,8 @@ def memoize(func):
return wrapper
-def get_call_location(frame_offset=0):
- frame = get_caller_frameinfo(frame_offset=frame_offset)
+def get_call_location():
+ frame = get_caller_frameinfo(frame_offset=1) # escape *this* function
return 'line {0} in {1}'.format(
frame.lineno,
path.relpath(frame.filename),
