Skip to content

Commit

Permalink
fix: compilation error on windows (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Nov 21, 2024
1 parent cb58991 commit b0ba49f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions a_sync/primitives/_debug.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The mixin provides a framework for managing a debug daemon task, which can be us
"""

import asyncio
import os
from asyncio.events import _running_loop
from threading import Lock
from typing import Optional
Expand All @@ -14,10 +15,6 @@ from a_sync.asyncio.create_task cimport ccreate_task_simple
from a_sync.primitives._loggable import _LoggerMixin


cdef extern from "unistd.h":
int getpid()


_global_lock = Lock()


Expand All @@ -29,7 +26,7 @@ cdef object _get_running_loop():
"""
cdef object running_loop, pid
running_loop, pid = _running_loop.loop_pid
if running_loop is not None and <int>pid == getpid():
if running_loop is not None and <int>pid == <int>os.getpid():
return running_loop


Expand Down

0 comments on commit b0ba49f

Please sign in to comment.