File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -213,10 +213,22 @@ static PyObject *
213213BaseException___reduce___impl (PyBaseExceptionObject * self )
214214/*[clinic end generated code: output=af87c1247ef98748 input=283be5a10d9c964f]*/
215215{
216- if (self -> args && self -> dict )
216+ 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+ return NULL ;
226+ }
227+ Py_DECREF (ts );
217228 return PyTuple_Pack (3 , Py_TYPE (self ), self -> args , self -> dict );
218- else
229+ } else {
219230 return PyTuple_Pack (2 , Py_TYPE (self ), self -> args );
231+ }
220232}
221233
222234/*
You can’t perform that action at this time.
0 commit comments