VirtualBox

Changeset 103379 in vbox


Ignore:
Timestamp:
Feb 15, 2024 9:16:36 AM (10 months ago)
Author:
vboxsync
Message:

Validation Kit/tdAudioTest: Compacted code within executeHstLoop() a bit, as differences for Python 2 / 3 are minimal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/audio/tdAudioTest.py

    r103348 r103379  
    329329            iRc  = 0;
    330330
    331             if sys.version_info[0] >= 3:
    332                 while oProcess.stdout.readable(): # pylint: disable=no-member
    333                     sStdOut = oProcess.stdout.readline();
    334                     if sStdOut:
    335                         sStdOut = sStdOut.strip();
    336                         reporter.log('%s: %s' % (sWhat, sStdOut.rstrip('\n')));
    337                     self.processEvents(0);
    338                     iRc = oProcess.poll();
    339                     if iRc is not None:
    340                         break;
    341             else: # Python 2.x cruft.
    342                 while True:
    343                     sStdOut = oProcess.stdout.readline();
    344                     if  sStdOut == '' \
    345                     and oProcess.poll() is not None:
    346                         break;
    347                     self.processEvents(0);
     331            while True if sys.version_info[0] < 3 else oProcess.stdout.readable(): # pylint: disable=no-member
     332                sStdOut = oProcess.stdout.readline();
     333                if sStdOut:
     334                    sStdOut = sStdOut.strip();
    348335                    reporter.log('%s [stdout]: %s' % (sWhat, sStdOut.rstrip('\n'),));
     336                self.processEvents(0);
     337                iRc = oProcess.poll();
     338                if iRc is not None:
     339                    break;
    349340
    350341            if iRc == 0:
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette