VirtualBox

Changeset 65970 in vbox for trunk


Ignore:
Timestamp:
Mar 7, 2017 11:05:12 AM (8 years ago)
Author:
vboxsync
Message:

ValidationKit/testboxscript: pylint 2.0.0 fixes

Location:
trunk/src/VBox/ValidationKit/testboxscript
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testboxscript/testboxcommons.py

    r62484 r65970  
    107107                fnLogger1('internal-error: Hit exception #2! %s' % (traceback.format_exc()), sCaller, sTsPrf);
    108108
    109             if len(asInfo) > 0:
     109            if asInfo:
    110110                # Do the logging.
    111111                for sItem in asInfo:
  • trunk/src/VBox/ValidationKit/testboxscript/testboxscript.py

    r65196 r65970  
    8989        asArgs = sys.argv[1:];
    9090        asArgs.insert(0, sRealScript);
    91         if sys.executable is not None and len(sys.executable) > 0:
     91        if sys.executable:
    9292            asArgs.insert(0, sys.executable);
    9393
     
    100100            if asArgs[i] == '--':
    101101                break;
    102         if sPidFile is not None and len(sPidFile) > 0:
     102        if sPidFile:
    103103            oPidFile = open(sPidFile, 'w');
    104104            oPidFile.write(str(os.getpid()));
  • trunk/src/VBox/ValidationKit/testboxscript/testboxscript_real.py

    r62471 r65970  
    233233        os.environ['TESTBOX_TIMEOUT_ABS']       = '0';
    234234
    235         if utils.getHostOs() is 'win':
     235        if utils.getHostOs() == 'win':
    236236            os.environ['COMSPEC']            = os.path.join(os.environ['SystemRoot'], 'System32', 'cmd.exe');
    237237        # Currently omitting any kBuild tools.
     
    10091009        for sPrefix in ['sBuilds', 'sTestRsrc']:
    10101010            sType = getattr(oOptions, sPrefix + 'ServerType');
    1011             if sType is None or len(sType.strip()) == 0:
     1011            if sType is None or not sType.strip():
    10121012                setattr(oOptions, sPrefix + 'ServerType', None);
    10131013            elif sType not in ['cifs', 'nfs']:
  • trunk/src/VBox/ValidationKit/testboxscript/testboxtasks.py

    r65196 r65970  
    195195
    196196        # If there is anything to flush, flush it.
    197         if len(asBackLog) > 0:
     197        if asBackLog:
    198198            sBody = '';
    199199            for sLine in asBackLog:
     
    357357
    358358        if asArgs[0].endswith('.py') and fWithInterpreter:
    359             if sys.executable is not None  and  len(sys.executable) > 0:
     359            if sys.executable:
    360360                asArgs.insert(0, sys.executable);
    361361            else:
     
    380380
    381381            # EOF?
    382             if len(sLine) == 0:
     382            if not sLine:
    383383                break;
    384384
     
    583583        # Tell the script to clean up.
    584584        #
    585         if len(self._sScriptCmdLine) > 0: # can be empty if cleanup crashed.
     585        if self._sScriptCmdLine: # can be empty if cleanup crashed.
    586586            (fRc, self._oChild) = self._spawnChild('cleanup-after');
    587587            if fRc is True:
     
    817817        for sArchive in asArchives:
    818818            sArchive = sArchive.strip();
    819             if len(sArchive) == 0:
     819            if not sArchive:
    820820                continue;
    821821
  • trunk/src/VBox/ValidationKit/testboxscript/testboxupgrade.py

    r62484 r65970  
    124124    asArgs = [os.path.join(sUpgradeDir, 'testboxscript', 'testboxscript', 'testboxscript.py'), '--version' ];
    125125    testboxcommons.log('Testing the new testbox script (%s)...' % (asArgs[0],));
    126     if sys.executable is not None and len(sys.executable) > 0:
     126    if sys.executable:
    127127        asArgs.insert(0, sys.executable);
    128128    oChild = subprocess.Popen(asArgs, shell = False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT);
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