We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a05766f commit cdb67f0Copy full SHA for cdb67f0
1 file changed
Objects/exceptions.c
@@ -213,10 +213,22 @@ static PyObject *
213
BaseException___reduce___impl(PyBaseExceptionObject *self)
214
/*[clinic end generated code: output=af87c1247ef98748 input=283be5a10d9c964f]*/
215
{
216
- if (self->args && self->dict)
+ if (!self->dict) {
217
+ self->dict = PyDict_New();
218
+ }
219
+ if (self->args && self->dict) {
220
+ PyObject *ts = PyLong_FromLongLong(self->timestamp_ns);
221
+ if (!ts)
222
+ return NULL;
223
+ if (PyDict_SetItemString(self->dict, "__timestamp_ns__", ts) == -1) {
224
+ Py_DECREF(ts);
225
226
227
228
return PyTuple_Pack(3, Py_TYPE(self), self->args, self->dict);
- else
229
+ } else {
230
return PyTuple_Pack(2, Py_TYPE(self), self->args);
231
232
}
233
234
/*
0 commit comments