Changeset 65196 in vbox for trunk/src/VBox/ValidationKit/common
- Timestamp:
- Jan 9, 2017 11:07:28 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/common/utils.py
r65007 r65196 435 435 return None; 436 436 437 def processPopenSafe(*aPositionalArgs, **dKeywordArgs): 438 """ 439 Wrapper for subprocess.Popen that's Ctrl-C safe on windows. 440 """ 441 if getHostOs() == 'win': 442 if dKeywordArgs.get('creationflags', 0) == 0: 443 dKeywordArgs['creationflags'] = subprocess.CREATE_NEW_PROCESS_GROUP; 444 return subprocess.Popen(*aPositionalArgs, **dKeywordArgs); 445 437 446 def processCall(*aPositionalArgs, **dKeywordArgs): 438 447 """ 439 Wrapper around subprocess.call to deal with its absen se in older448 Wrapper around subprocess.call to deal with its absence in older 440 449 python versions. 441 450 Returns process exit code (see subprocess.poll). … … 444 453 assert dKeywordArgs.get('stderr') is None; 445 454 _processFixPythonInterpreter(aPositionalArgs, dKeywordArgs); 446 oProcess = subprocess.Popen(*aPositionalArgs, **dKeywordArgs);455 oProcess = processPopenSafe(*aPositionalArgs, **dKeywordArgs); 447 456 return oProcess.wait(); 448 457 … … 453 462 """ 454 463 _processFixPythonInterpreter(aPositionalArgs, dKeywordArgs); 455 oProcess = subprocess.Popen(stdout=subprocess.PIPE, *aPositionalArgs, **dKeywordArgs);464 oProcess = processPopenSafe(stdout=subprocess.PIPE, *aPositionalArgs, **dKeywordArgs); 456 465 457 466 sOutput, _ = oProcess.communicate(); … … 541 550 def sudoProcessPopen(*aPositionalArgs, **dKeywordArgs): 542 551 """ 543 sudo (or similar) + subprocess.Popen.552 sudo (or similar) + processPopenSafe. 544 553 """ 545 554 _processFixPythonInterpreter(aPositionalArgs, dKeywordArgs); 546 555 _sudoFixArguments(aPositionalArgs, dKeywordArgs); 547 return subprocess.Popen(*aPositionalArgs, **dKeywordArgs);556 return processPopenSafe(*aPositionalArgs, **dKeywordArgs); 548 557 549 558
Note:
See TracChangeset
for help on using the changeset viewer.