aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Lib/trace.py
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2024-07-08 15:54:05 +0000
committerAlexander Smirnov <alex@ydb.tech>2024-07-08 15:54:05 +0000
commitfc7be18c76af2e700641f3598c4856baeef1428e (patch)
tree11dbca45eb321c3a4dd08b12152acc6ef5dd3fa9 /contrib/tools/python3/Lib/trace.py
parentec0e7ed6da6fb317741fd8468602949a1362eca5 (diff)
parentc92cb9d3a19331916f0c274d80e67f02a62caa9b (diff)
downloadydb-fc7be18c76af2e700641f3598c4856baeef1428e.tar.gz
Merge branch 'rightlib' into mergelibs-240708-1553
Diffstat (limited to 'contrib/tools/python3/Lib/trace.py')
-rwxr-xr-xcontrib/tools/python3/Lib/trace.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/contrib/tools/python3/Lib/trace.py b/contrib/tools/python3/Lib/trace.py
index 761916b180..a50a310e6a 100755
--- a/contrib/tools/python3/Lib/trace.py
+++ b/contrib/tools/python3/Lib/trace.py
@@ -559,8 +559,12 @@ class Trace:
if self.start_time:
print('%.2f' % (_time() - self.start_time), end=' ')
bname = os.path.basename(filename)
- print("%s(%d): %s" % (bname, lineno,
- linecache.getline(filename, lineno)), end='')
+ line = linecache.getline(filename, lineno)
+ print("%s(%d)" % (bname, lineno), end='')
+ if line:
+ print(": ", line, end='')
+ else:
+ print()
return self.localtrace
def localtrace_trace(self, frame, why, arg):
@@ -572,8 +576,12 @@ class Trace:
if self.start_time:
print('%.2f' % (_time() - self.start_time), end=' ')
bname = os.path.basename(filename)
- print("%s(%d): %s" % (bname, lineno,
- linecache.getline(filename, lineno)), end='')
+ line = linecache.getline(filename, lineno)
+ print("%s(%d)" % (bname, lineno), end='')
+ if line:
+ print(": ", line, end='')
+ else:
+ print()
return self.localtrace
def localtrace_count(self, frame, why, arg):