File tree 1 file changed +8
-7
lines changed 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):
90
90
91
91
os_close(self ._errpipe_write)
92
92
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
99
100
100
101
finally :
101
102
os_close(self ._errpipe_read)
@@ -121,7 +122,7 @@ cdef class UVProcess(UVHandle):
121
122
if debug_flags & __PROCESS_DEBUG_SLEEP_AFTER_FORK:
122
123
time_sleep(1 )
123
124
124
- if errpipe_data:
125
+ if preexec_fn is not None and errpipe_data:
125
126
# preexec_fn has raised an exception. The child
126
127
# process must be dead now.
127
128
try :
You can’t perform that action at this time.
0 commit comments