Skip to content

Commit 09a547a

Browse files
committed
minor cleanups
1 parent b065394 commit 09a547a

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

Lib/traceback.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
'FrameSummary', 'StackSummary', 'TracebackException',
1919
'walk_stack', 'walk_tb', 'print_list']
2020

21-
2221
#
2322
# Formatting and printing lists of traceback lines.
2423
#
@@ -1083,11 +1082,7 @@ def __init__(self, exc_type, exc_value, exc_traceback, *, limit=None,
10831082
self.__notes__ = [
10841083
f'Ignored error getting __notes__: {_safe_string(e, '__notes__', repr)}']
10851084

1086-
if _TIMESTAMP_FORMAT:
1087-
self._timestamp_ns = exc_value.__timestamp_ns__
1088-
else:
1089-
self._timestamp_ns = 0
1090-
1085+
self._timestamp_ns = exc_value.__timestamp_ns__ if _TIMESTAMP_FORMAT else 0
10911086
self._is_syntax_error = False
10921087
self._have_exc_type = exc_type is not None
10931088
if exc_type is not None:

Objects/exceptions.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,7 @@ BaseException___reduce___impl(PyBaseExceptionObject *self)
244244
if (!BaseException_add_timestamp_to_dict(self, self->dict)) {
245245
return NULL;
246246
}
247-
if (self->args && self->dict) {
248-
return PyTuple_Pack(3, Py_TYPE(self), self->args, self->dict);
249-
} else {
250-
return PyTuple_Pack(2, Py_TYPE(self), self->args);
251-
}
247+
return PyTuple_Pack(3, Py_TYPE(self), self->args, self->dict);
252248
}
253249

254250
/*

0 commit comments

Comments
 (0)