diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-01-15 14:01:08 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-01-15 14:18:00 -0500 |
commit | 4eac4a51c089d90478c81a5e7b483744ef0aa4fe (patch) | |
tree | ad5c6220ee438ff9ffea31a41f814c60096efb0f | |
parent | 37ef7c7d8625ee7f364774110e3c467e82444d9b (diff) | |
download | python-coveragepy-git-4eac4a51c089d90478c81a5e7b483744ef0aa4fe.tar.gz |
test: slightly nicer bpo prelude
-rw-r--r-- | lab/bpo_prelude.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lab/bpo_prelude.py b/lab/bpo_prelude.py index cc86a84d..14a5fc66 100644 --- a/lab/bpo_prelude.py +++ b/lab/bpo_prelude.py @@ -4,7 +4,8 @@ def trace(frame, event, arg): # The weird globals here is to avoid a NameError on shutdown... if frame.f_code.co_filename == globals().get("__file__"): lineno = frame.f_lineno - print("{} {}: {}".format(event[:4], lineno, linecache.getline(__file__, lineno).rstrip())) + line = linecache.getline(__file__, lineno).rstrip() + print("{} {}: {}".format(event[:4], lineno, line)) return trace print(sys.version) |