File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -90,12 +90,13 @@ cdef class UVProcess(UVHandle):
9090
9191 os_close(self ._errpipe_write)
9292
93- errpipe_data = bytearray()
94- while True :
95- part = os_read(self ._errpipe_read, 50000 )
96- errpipe_data += part
97- if not part or len (errpipe_data) > 50000 :
98- break
93+ if preexec_fn is not None :
94+ errpipe_data = bytearray()
95+ while True :
96+ part = os_read(self ._errpipe_read, 50000 )
97+ errpipe_data += part
98+ if not part or len (errpipe_data) > 50000 :
99+ break
99100
100101 finally :
101102 os_close(self ._errpipe_read)
@@ -121,7 +122,7 @@ cdef class UVProcess(UVHandle):
121122 if debug_flags & __PROCESS_DEBUG_SLEEP_AFTER_FORK:
122123 time_sleep(1 )
123124
124- if errpipe_data:
125+ if preexec_fn is not None and errpipe_data:
125126 # preexec_fn has raised an exception. The child
126127 # process must be dead now.
127128 try :
You can’t perform that action at this time.
0 commit comments