Skip to content

Commit 4ed37f6

Browse files
committed
Add #ifdef Py_DEBUG
1 parent 5ce1ed0 commit 4ed37f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Objects/setobject.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,9 +1186,11 @@ set_update_dict_lock_held(PySetObject *so, PyObject *other)
11861186
assert(PyAnyDict_CheckExact(other));
11871187

11881188
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(so);
1189+
#ifdef Py_DEBUG
11891190
if (!PyFrozenDict_CheckExact(other)) {
11901191
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(other);
11911192
}
1193+
#endif
11921194

11931195
/* Do one big resize at the start, rather than
11941196
* incrementally resizing as we insert new keys. Expect
@@ -2181,9 +2183,11 @@ static int
21812183
set_symmetric_difference_update_dict(PySetObject *so, PyObject *other)
21822184
{
21832185
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(so);
2186+
#ifdef Py_DEBUG
21842187
if (!PyFrozenDict_CheckExact(other)) {
21852188
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(other);
21862189
}
2190+
#endif
21872191

21882192
Py_ssize_t pos = 0;
21892193
PyObject *key, *value;

0 commit comments

Comments
 (0)