Skip to content

Commit fbcbb83

Browse files
remove minor redundant code from _asyncio
1 parent 9ecd8f7 commit fbcbb83

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

Modules/_asynciomodule.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "pycore_freelist.h" // _Py_FREELIST_POP()
99
#include "pycore_modsupport.h" // _PyArg_CheckPositional()
1010
#include "pycore_moduleobject.h" // _PyModule_GetState()
11-
#include "pycore_object.h" // _Py_SetImmortalUntracked
11+
#include "pycore_object.h" // _Py_SetImmortalUntracked()
1212
#include "pycore_pyerrors.h" // _PyErr_ClearExcState()
1313
#include "pycore_pylifecycle.h" // _Py_IsInterpreterFinalizing()
1414
#include "pycore_pystate.h" // _PyThreadState_GET()
@@ -77,15 +77,8 @@ typedef struct {
7777
#define Future_Check(state, obj) PyObject_TypeCheck(obj, state->FutureType)
7878
#define Task_Check(state, obj) PyObject_TypeCheck(obj, state->TaskType)
7979

80-
#ifdef Py_GIL_DISABLED
81-
# define ASYNCIO_STATE_LOCK(state) Py_BEGIN_CRITICAL_SECTION_MUT(&state->mutex)
82-
# define ASYNCIO_STATE_UNLOCK(state) Py_END_CRITICAL_SECTION()
83-
#else
84-
# define ASYNCIO_STATE_LOCK(state) ((void)state)
85-
# define ASYNCIO_STATE_UNLOCK(state) ((void)state)
86-
#endif
87-
88-
typedef struct futureiterobject futureiterobject;
80+
#define ASYNCIO_STATE_LOCK(state) Py_BEGIN_CRITICAL_SECTION_MUT(&state->mutex)
81+
#define ASYNCIO_STATE_UNLOCK(state) Py_END_CRITICAL_SECTION()
8982

9083
/* State of the _asyncio module */
9184
typedef struct {

0 commit comments

Comments
 (0)