Changeset 70566 in vbox for trunk/src/VBox/ValidationKit/common/utils.py
- Timestamp:
- Jan 12, 2018 6:25:48 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/common/utils.py
r70518 r70566 104 104 else: 105 105 try: 106 sArch = processOutputChecked(['/usr/bin/isainfo', '-n',]);106 sArch = str(processOutputChecked(['/usr/bin/isainfo', '-n',])); 107 107 except: 108 108 pass; … … 586 586 Wrapper around subprocess.check_output to deal with its absense in older 587 587 python versions. 588 """ 588 Extra keyword: sEncoding='utf-8; for specifying now output is to be decoded. 589 """ 590 sEncoding = dKeywordArgs.get('sEncoding'); 591 if sEncoding is not None: del dKeywordArgs['sEncoding']; 592 else: sEncoding = 'utf-8'; 593 589 594 _processFixPythonInterpreter(aPositionalArgs, dKeywordArgs); 590 595 oProcess = processPopenSafe(stdout=subprocess.PIPE, *aPositionalArgs, **dKeywordArgs); … … 600 605 raise subprocess.CalledProcessError(iExitCode, asArgs); 601 606 602 return s tr(sOutput); # str() make pylint happy.607 return sOutput.decode(sEncoding); 603 608 604 609 g_fOldSudo = None; … … 625 630 if g_fOldSudo is None: 626 631 try: 627 sVersion = processOutputChecked(['sudo', '-V']);632 sVersion = str(processOutputChecked(['sudo', '-V'])); 628 633 except: 629 634 sVersion = '1.7.0';
Note:
See TracChangeset
for help on using the changeset viewer.