VirtualBox

Changeset 79092 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jun 11, 2019 3:26:40 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131252
Message:

ValKit,++: Pylint 2.3.1 adjustments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py

    r76553 r79092  
    621621        self.sSelector      = sSelector;        ##< The member selector, see kdSelectors.
    622622        self.sEncoding      = sEncoding;        ##< The encoding, see kdSelectors.
    623         self.aoInstructions = [];               # type: Instruction
     623        self.aoInstructions = []                # type: Instruction
    624624        self.sDisParse      = sDisParse;        ##< IDX_ParseXXX.
    625625
     
    12781278
    12791279    def __init__(self, oInstr): # type: (InstructionTest, Instruction)
    1280         self.oInstr         = oInstr;   # type: InstructionTest
    1281         self.aoInputs       = [];       # type: list(TestInOut)
    1282         self.aoOutputs      = [];       # type: list(TestInOut)
    1283         self.aoSelectors    = [];       # type: list(TestSelector)
     1280        self.oInstr         = oInstr    # type: InstructionTest
     1281        self.aoInputs       = []        # type: list(TestInOut)
     1282        self.aoOutputs      = []        # type: list(TestInOut)
     1283        self.aoSelectors    = []        # type: list(TestSelector)
    12841284
    12851285    def toString(self, fRepr = False):
     
    13401340        self.sMnemonic      = None;
    13411341        self.sBrief         = None;
    1342         self.asDescSections = [];       # type: list(str)
    1343         self.aoMaps         = [];       # type: list(InstructionMap)
    1344         self.aoOperands     = [];       # type: list(Operand)
     1342        self.asDescSections = []        # type: list(str)
     1343        self.aoMaps         = []        # type: list(InstructionMap)
     1344        self.aoOperands     = []        # type: list(Operand)
    13451345        self.sPrefix        = None;     ##< Single prefix: None, 'none', 0x66, 0xf3, 0xf2
    1346         self.sOpcode        = None;     # type: str
    1347         self.sSubOpcode     = None;     # type: str
     1346        self.sOpcode        = None      # type: str
     1347        self.sSubOpcode     = None      # type: str
    13481348        self.sEncoding      = None;
    13491349        self.asFlTest       = None;
     
    13561356        self.asCpuIds       = [];       ##< The CPUID feature bit names for this instruction. If multiple, assume AND.
    13571357        self.asReqFeatures  = [];       ##< Which features are required to be enabled to run this instruction.
    1358         self.aoTests        = [];       # type: list(InstructionTest)
     1358        self.aoTests        = []        # type: list(InstructionTest)
    13591359        self.sMinCpu        = None;     ##< Indicates the minimum CPU required for the instruction. Not set when oCpuExpr is.
    13601360        self.oCpuExpr       = None;     ##< Some CPU restriction expression...
     
    14261426        sRet = '<' if fRepr else '';
    14271427        for sField, sValue in aasFields:
    1428             if sValue != None:
     1428            if sValue is not None:
    14291429                if len(sRet) > 1:
    14301430                    sRet += '; ';
     
    15161516
    15171517## All the instructions.
    1518 g_aoAllInstructions = []; # type: list(Instruction)
     1518g_aoAllInstructions = []            # type: list(Instruction)
    15191519
    15201520## All the instructions indexed by statistics name (opstat).
    1521 g_dAllInstructionsByStat = {}; # type: dict(Instruction)
     1521g_dAllInstructionsByStat = {}      # type: dict(Instruction)
    15221522
    15231523## All the instructions indexed by function name (opfunction).
    1524 g_dAllInstructionsByFunction = {}; # type: dict(list(Instruction))
     1524g_dAllInstructionsByFunction = {}  # type: dict(list(Instruction))
    15251525
    15261526## Instructions tagged by oponlytest
    1527 g_aoOnlyTestInstructions = []; # type: list(Instruction)
     1527g_aoOnlyTestInstructions = []      # type: list(Instruction)
    15281528
    15291529## Instruction maps.
     
    19761976            return self.errorComment(iTagLine, '%s: value too long (max 180 chars): %s' % (sTag, sBrief));
    19771977        offDot = sBrief.find('.');
    1978         while offDot >= 0 and offDot < len(sBrief) - 1 and sBrief[offDot + 1] != ' ':
     1978        while 0 <= offDot < len(sBrief) - 1 and sBrief[offDot + 1] != ' ':
    19791979            offDot = sBrief.find('.', offDot + 1);
    19801980        if offDot >= 0 and offDot != len(sBrief) - 1:
     
    20422042        oInstr = self.ensureInstructionForOpTag(iTagLine);
    20432043        idxOp = int(sTag[-1]) - 1;
    2044         assert idxOp >= 0 and idxOp < 4;
     2044        assert 0 <= idxOp < 4;
    20452045
    20462046        # flatten, split up, and validate the "where:type" value.
     
    25842584                            self.errorComment(iTagLine, '%s: invalid %s field "%s" in "%s"\nvalid fields: %s'
    25852585                                                         % ( sTag, sDesc, sField, sItem,
    2586                                                              ', '.join([sKey for sKey in TestInOut.kdFields.keys()
     2586                                                             ', '.join([sKey for sKey in TestInOut.kdFields
    25872587                                                                        if TestInOut.kdFields[sKey][1] in asValidFieldKinds]),));
    25882588                        break;
     
    29272927                elif ch == chQuote:
    29282928                    chQuote = None;
    2929             elif ch == '"' or ch == '\'':
     2929            elif ch in ('"', '\'',):
    29302930                chQuote = ch;
    2931             elif ch == ',' or ch == ')':
     2931            elif ch in (',', ')',):
    29322932                if cDepth == 1:
    29332933                    asRet.append(sInvocation[offStart:off].strip());
     
    33193319    except ParserException as oXcpt:
    33203320        print(str(oXcpt));
    3321         raise;
    3322     except Exception as oXcpt:
    33233321        raise;
    33243322
Note: See TracChangeset for help on using the changeset viewer.

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