2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 00:52:16 +00:00

Port errors.nearest_user_location().

This commit is contained in:
Aaron Boman
2016-10-08 16:08:09 -05:00
parent eee3ebdb2c
commit 9bee7e8d20

View File

@@ -123,5 +123,13 @@ class Errors:
stack=traceback.extract_stack())
def nearest_user_location():
"""
Returns:
tuple: the filename and line number of the nearest user location
"""
bt = bjam.backtrace()
if not bt:
return None
last = bt[-1]
return last[0], last[1]