Skip to content

Commit 986f23a

Browse files
committed
Fix non-debug build.
1 parent da2a0ad commit 986f23a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Objects/typeobject.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ types_world_is_stopped(void)
102102
#define TYPE_IS_REVEALED(tp) 0
103103
#endif
104104

105+
#ifdef Py_DEBUG
105106
#define ASSERT_TYPE_LOCK_HELD() \
106107
if (!types_world_is_stopped()) { _Py_CRITICAL_SECTION_ASSERT_MUTEX_LOCKED(TYPE_LOCK); }
107108

@@ -111,6 +112,11 @@ types_world_is_stopped(void)
111112

112113
#define ASSERT_NEW_OR_LOCKED(tp) \
113114
if (TYPE_IS_REVEALED(tp)) { ASSERT_TYPE_LOCK_HELD(); }
115+
#else
116+
#define ASSERT_TYPE_LOCK_HELD()
117+
#define ASSERT_NEW_OR_STOPPED(tp)
118+
#define ASSERT_NEW_OR_LOCKED(tp)
119+
#endif
114120

115121
static void
116122
types_stop_world(void)

0 commit comments

Comments
 (0)