Skip to content

Commit

Permalink
Drop Python 3.6 support for thread ident
Browse files Browse the repository at this point in the history
Python 3.6 uses `long` for thread ident, while 3.7 uses `unsigned long`.
  • Loading branch information
fantix committed Sep 9, 2022
1 parent cdab9d3 commit 9c37930
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions uvloop/loop.pyx
Expand Up @@ -218,7 +218,7 @@ cdef class Loop:
cdef inline _is_main_thread(self):
cdef uint64_t main_thread_id = system.MAIN_THREAD_ID
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)
return main_thread_id == PyThread_get_thread_ident()

Expand Down Expand Up @@ -711,7 +711,7 @@ cdef class Loop:
return

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:
raise RuntimeError(
Expand Down

0 comments on commit 9c37930

Please sign in to comment.