VirtualBox

Changeset 97269 in vbox


Ignore:
Timestamp:
Oct 24, 2022 7:54:52 AM (2 years ago)
Author:
vboxsync
Message:

ValKit/testboxscript.py: pylint fixes.

File:
1 edited

Legend:

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

    r96407 r97269  
    113113                break;
    114114        if sPidFile:
    115             oPidFile = open(sPidFile, 'w');
    116             oPidFile.write(str(os.getpid()));
    117             oPidFile.close();
     115            with open(sPidFile, 'w') as oPidFile:
     116                oPidFile.write(str(os.getpid()));
    118117
    119118        # Execute the testbox script almost forever in a relaxed loop.
     
    123122            if platform.system() == 'Windows':
    124123                fCreationFlags = getattr(subprocess, 'CREATE_NEW_PROCESS_GROUP', 0x00000200); # for Ctrl-C isolation (python 2.7)
    125             self.oTask = subprocess.Popen(asArgs, shell = False, creationflags = fCreationFlags);
     124            self.oTask = subprocess.Popen(asArgs, shell = False,           # pylint: disable=consider-using-with
     125                                          creationflags = fCreationFlags);
    126126            rcExit = self.oTask.wait();
    127127            self.oTask = None;
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