Skip to content

Commit 46bbb87

Browse files
committed
don't let strip_exc_timestamps be conditional, it processes data from other processes in tests as well
1 parent 13fa0d1 commit 46bbb87

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Lib/traceback.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,14 @@ def _timestamp_formatter(ns):
223223

224224
def strip_exc_timestamps(output):
225225
"""Remove exception timestamps from output; for use by tests."""
226-
if _TIMESTAMP_FORMAT:
227-
import re
228-
if isinstance(output, str):
229-
pattern = TIMESTAMP_AFTER_EXC_MSG_RE_GROUP
230-
empty = ""
231-
else:
232-
pattern = TIMESTAMP_AFTER_EXC_MSG_RE_GROUP.encode()
233-
empty = b""
234-
return re.sub(pattern, empty, output, flags=re.MULTILINE)
235-
return output
226+
import re
227+
if isinstance(output, str):
228+
pattern = TIMESTAMP_AFTER_EXC_MSG_RE_GROUP
229+
empty = ""
230+
else:
231+
pattern = TIMESTAMP_AFTER_EXC_MSG_RE_GROUP.encode()
232+
empty = b""
233+
return re.sub(pattern, empty, output, flags=re.MULTILINE)
236234

237235

238236
# -- not official API but folk probably use these two functions.

0 commit comments

Comments
 (0)