Skip to content

Commit

Permalink
Do not call PyEval_InitThreads
Browse files Browse the repository at this point in the history
Since Python 3.7, it’s called by Py_Initialize and doesn’t need to be called manually, so this removal has no effect.

Since Python 3.9, it does nothing, and in Python 3.13, it will be removed, which makes this change necessary.

References:

https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads

python/cpython#105182
  • Loading branch information
musicinmybrain committed Nov 2, 2023
1 parent a62c260 commit 3100ba8
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/python/grpcio/grpc/_cython/cygrpc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,7 @@ include "_cygrpc/aio/server.pyx.pxi"
#
# initialize gRPC
#
cdef extern from "Python.h":

int PyEval_InitThreads()

cdef _initialize():
# We have Python callbacks called by c-core threads, this ensures the GIL
# is initialized.
PyEval_InitThreads()
grpc_set_ssl_roots_override_callback(
<grpc_ssl_roots_override_callback>ssl_roots_override_callback)

Expand Down

0 comments on commit 3100ba8

Please sign in to comment.