diff options
author | Devtools Arcadia <[email protected]> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <[email protected]> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/tools/cython/Cython/Debugging.py |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/tools/cython/Cython/Debugging.py')
-rw-r--r-- | contrib/tools/cython/Cython/Debugging.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/tools/cython/Cython/Debugging.py b/contrib/tools/cython/Cython/Debugging.py new file mode 100644 index 00000000000..edb3f4e8ca5 --- /dev/null +++ b/contrib/tools/cython/Cython/Debugging.py @@ -0,0 +1,20 @@ +############################################### +# +# Odds and ends for debugging +# +############################################### + +def print_call_chain(*args): + import sys + print(" ".join(map(str, args))) + f = sys._getframe(1) + while f: + name = f.f_code.co_name + s = f.f_locals.get('self', None) + if s: + c = getattr(s, "__class__", None) + if c: + name = "%s.%s" % (c.__name__, name) + print("Called from: %s %s" % (name, f.f_lineno)) + f = f.f_back + print("-" * 70) |