File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -955,18 +955,22 @@ extension Process {
955
955
queue: DispatchQueue ? = nil ,
956
956
completion: @escaping ( Result < ProcessResult , Swift . Error > ) -> Void
957
957
) {
958
+ let completionQueue = queue ?? Self . sharedCompletionQueue
959
+
958
960
do {
959
961
let process = Process (
960
962
arguments: arguments,
961
963
environment: environment,
962
964
outputRedirection: . collect,
963
965
loggingHandler: loggingHandler
964
966
)
965
- process. completionQueue = queue ?? Self . sharedCompletionQueue
967
+ process. completionQueue = completionQueue
966
968
try process. launch ( )
967
969
process. waitUntilExit ( completion)
968
970
} catch {
969
- completion ( . failure( error) )
971
+ completionQueue. async {
972
+ completion ( . failure( error) )
973
+ }
970
974
}
971
975
}
972
976
You can’t perform that action at this time.
0 commit comments