@@ -124,14 +124,19 @@ mod for_windows {
124
124
// (only when wrongly setting the environmental variable),
125
125
// it might be better to improve the experience of the second case
126
126
// when users have interrupted the parent process and we haven't finish
127
- // duplicating the handle yet. We just need close the job object if that occurs.
128
- CloseHandle ( job) . ok ( ) ;
127
+ // duplicating the handle yet.
129
128
return ;
130
129
}
131
130
} ;
132
131
133
132
let mut parent_handle = HANDLE :: default ( ) ;
134
- let r = DuplicateHandle (
133
+ // If this fails, well at least we tried! An example of DuplicateHandle
134
+ // failing in the past has been when the wrong python2 package spawned this
135
+ // build system (e.g., the `python2` package in MSYS instead of
136
+ // `mingw-w64-x86_64-python2`). Not sure why it failed, but the "failure
137
+ // mode" here is that we only clean everything up when the build system
138
+ // dies, not when the python parent does, so not too bad.
139
+ let _ = DuplicateHandle (
135
140
GetCurrentProcess ( ) ,
136
141
job,
137
142
parent,
@@ -140,15 +145,6 @@ mod for_windows {
140
145
false ,
141
146
DUPLICATE_SAME_ACCESS ,
142
147
) ;
143
-
144
- // If this failed, well at least we tried! An example of DuplicateHandle
145
- // failing in the past has been when the wrong python2 package spawned this
146
- // build system (e.g., the `python2` package in MSYS instead of
147
- // `mingw-w64-x86_64-python2`). Not sure why it failed, but the "failure
148
- // mode" here is that we only clean everything up when the build system
149
- // dies, not when the python parent does, so not too bad.
150
- if r. is_err ( ) {
151
- CloseHandle ( job) . ok ( ) ;
152
- }
148
+ CloseHandle ( parent) . ok ( ) ;
153
149
}
154
150
}
0 commit comments