Drop Python 3.6 support for thread ident

Python 3.6 uses `long` for thread ident, while 3.7 uses `unsigned long`.
This commit is contained in:
Fantix King 2022-09-09 15:36:10 -04:00
parent cdab9d3e07
commit 9c37930e6f
1 changed files with 2 additions and 2 deletions

View File

@ -218,7 +218,7 @@ cdef class Loop:
cdef inline _is_main_thread(self): cdef inline _is_main_thread(self):
cdef uint64_t main_thread_id = system.MAIN_THREAD_ID cdef uint64_t main_thread_id = system.MAIN_THREAD_ID
if system.MAIN_THREAD_ID_SET == 0: if system.MAIN_THREAD_ID_SET == 0:
main_thread_id = <uint64_t><int64_t>threading_main_thread().ident main_thread_id = <uint64_t>threading_main_thread().ident
system.setMainThreadID(main_thread_id) system.setMainThreadID(main_thread_id)
return main_thread_id == PyThread_get_thread_ident() return main_thread_id == PyThread_get_thread_ident()
@ -711,7 +711,7 @@ cdef class Loop:
return return
cdef uint64_t thread_id cdef uint64_t thread_id
thread_id = <uint64_t><int64_t>PyThread_get_thread_ident() thread_id = <uint64_t>PyThread_get_thread_ident()
if thread_id != self._thread_id: if thread_id != self._thread_id:
raise RuntimeError( raise RuntimeError(