Skip to content

Commit 994560c

Browse files
committed
try placing __forking variables outside of system OS check
1 parent acd5a8b commit 994560c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

uvloop/handles/process.pyx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ cdef class UVProcess(UVHandle):
9191
self._restore_signals = restore_signals
9292

9393
loop.active_process_handler = self
94+
__forking = 1
95+
__forking_loop = loop
96+
9497
if not system.PLATFORM_IS_WINDOWS:
95-
__forking = 1
96-
__forking_loop = loop
9798
system.setForkHandler(<system.OnForkHandler>&__get_fork_handler)
9899

99100
PyOS_BeforeFork()
@@ -102,9 +103,10 @@ cdef class UVProcess(UVHandle):
102103
<uv.uv_process_t*>self._handle,
103104
&self.options)
104105

106+
__forking = 0
107+
__forking_loop = None
105108
if not system.PLATFORM_IS_WINDOWS:
106-
__forking = 0
107-
__forking_loop = None
109+
108110
system.resetForkHandler()
109111

110112
PyOS_AfterFork_Parent()

0 commit comments

Comments
 (0)