Skip to content

Commit e6199e3

Browse files
committed
post merge fixups
1 parent b564e63 commit e6199e3

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

Objects/exceptions.c

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ BaseException_repr(PyObject *op)
237237

238238
/* Pickling support */
239239

240-
/* Returns dict on success, after having added a __timestamp_ns__ key; NULL
241-
otherwise. dict does not have to be self->dict as the getstate use case
242-
often uses a copy. No key is added if its value would be 0. */
240+
/* Returns dict on success, after having maybe added a __timestamp_ns__ key;
241+
NULL on error. dict does not have to be self->dict as the getstate use
242+
case often uses a copy. No key is added if its value would be 0. */
243243
static PyObject* BaseException_add_timestamp_to_dict(PyBaseExceptionObject *self, PyObject *dict)
244244
{
245245
assert(dict != NULL);
@@ -249,7 +249,7 @@ static PyObject* BaseException_add_timestamp_to_dict(PyBaseExceptionObject *self
249249
PyObject *ts = PyLong_FromLongLong(self->timestamp_ns);
250250
if (!ts)
251251
return NULL;
252-
if (PyDict_SetItemString(dict, "__timestamp_ns__", ts) == -1) {
252+
if (PyDict_SetItemString(dict, &_Py_ID(__timestamp_ns__), ts) == -1) {
253253
Py_DECREF(ts);
254254
return NULL;
255255
}
@@ -1879,21 +1879,6 @@ ImportError_getstate(PyObject *op)
18791879
if (dict == NULL) {
18801880
return NULL;
18811881
}
1882-
if (self->name || self->path || self->name_from) {
1883-
if (self->name && PyDict_SetItem(dict, &_Py_ID(name), self->name) < 0) {
1884-
Py_DECREF(dict);
1885-
return NULL;
1886-
}
1887-
if (self->path && PyDict_SetItem(dict, &_Py_ID(path), self->path) < 0) {
1888-
Py_DECREF(dict);
1889-
return NULL;
1890-
}
1891-
if (self->name_from && PyDict_SetItem(dict, &_Py_ID(name_from), self->name_from) < 0) {
1892-
Py_DECREF(dict);
1893-
return NULL;
1894-
}
1895-
return dict;
1896-
}
18971882
if (!BaseException_add_timestamp_to_dict((PyBaseExceptionObject *)self, dict)) {
18981883
Py_DECREF(dict);
18991884
return NULL;

Python/sysmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3453,6 +3453,7 @@ set_flags_from_config(PyInterpreterState *interp, PyObject *flags)
34533453

34543454
/* Set the flag with our string value */
34553455
SetFlagObj(ts_str);
3456+
34563457
/* REMEMBER: the order of the SetFlag ops MUST match that of flags_fields */
34573458
#undef SetFlagObj
34583459
#undef SetFlag

0 commit comments

Comments
 (0)