Skip to content

Commit bb4e191

Browse files
committed
Add Py_DEBUG
1 parent 3b4e823 commit bb4e191

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Modules/_decimal/_decimal.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -2308,10 +2308,11 @@ PyDecType_FromFloatExact(PyTypeObject *type, PyObject *v,
23082308
mpd_t *d1, *d2;
23092309
uint32_t status = 0;
23102310
mpd_context_t maxctx;
2311-
decimal_state *state = GLOBAL_STATE();
23122311

2312+
#ifdef Py_DEBUG
2313+
decimal_state *state = GLOBAL_STATE();
23132314
assert(PyType_IsSubtype(type, state->PyDec_Type));
2314-
2315+
#endif
23152316
if (PyLong_Check(v)) {
23162317
return PyDecType_FromLongExact(type, v, context);
23172318
}
@@ -4606,10 +4607,11 @@ dec_richcompare(PyObject *v, PyObject *w, int op)
46064607
uint32_t status = 0;
46074608
int a_issnan, b_issnan;
46084609
int r;
4609-
decimal_state *state = GLOBAL_STATE();
46104610

4611+
#ifdef Py_DEBUG
4612+
decimal_state *state = GLOBAL_STATE();
46114613
assert(PyDec_Check(state, v));
4612-
4614+
#endif
46134615
CURRENT_CONTEXT(context);
46144616
CONVERT_BINOP_CMP(&a, &b, v, w, op, context);
46154617

0 commit comments

Comments
 (0)