Ignore:
Timestamp:
Aug 23, 2013, 1:50:01 PM (12 years ago)
Author:
[email protected]
Message:

Failure building with python3
https://bugs.webkit.org/show_bug.cgi?id=106645

Patch by Laszlo Papp <[email protected]> on 2013-08-23
Reviewed by Benjamin Poulain.

Use print functions instead of python statements to be compatible with python 3.X and 2.7 as well.
Archlinux has been using python3 and that is what causes issues while packaging QtWebKit along with Qt5.

  • disassembler/udis86/itab.py:

(UdItabGenerator.genInsnTable):

  • disassembler/udis86/ud_opcode.py:

(UdOpcodeTables.print_table):

  • disassembler/udis86/ud_optable.py:

(UdOptableXmlParser.parseDef):
(UdOptableXmlParser.parse):
(printFn):

Location:
trunk/Source/JavaScriptCore/disassembler/udis86
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/disassembler/udis86/itab.py

    r133415 r154521  
    269269            for i in range(len(opr)):
    270270                if not (opr[i] in self.OperandDict.keys()):
    271                     print "error: invalid operand declaration: %s\n" % opr[i]
     271                    print("error: invalid operand declaration: %s\n" % opr[i])
    272272                opr_c[i] = "O_" + opr[i]
    273273            opr = "%s %s %s" % (opr_c[0] + ",", opr_c[1] + ",", opr_c[2])
     
    275275            for p in e['prefixes']:
    276276                if not ( p in self.PrefixDict.keys() ):
    277                     print "error: invalid prefix specification: %s \n" % pfx
     277                    print("error: invalid prefix specification: %s \n" % pfx)
    278278                pfx_c.append( self.PrefixDict[p] )
    279279            if len(e['prefixes']) == 0:
  • trunk/Source/JavaScriptCore/disassembler/udis86/ud_opcode.py

    r120745 r154521  
    219219
    220220    def print_table( self, table, pfxs ):
    221         print "%s   |" % pfxs
     221        print("%s   |" % pfxs)
    222222        keys = table[ 'entries' ].keys()
    223223        if ( len( keys ) ):
     
    226226            e = table[ 'entries' ][ idx ]
    227227            if e[ 'type' ] == 'insn':
    228                 print "%s   |-<%s>" % ( pfxs, idx ),
    229                 print  "%s %s" % ( e[ 'mnemonic' ], ' '.join( e[ 'operands'] ) )
     228                print("%s   |-<%s>" % ( pfxs, idx )),
     229                print("%s %s" % ( e[ 'mnemonic' ], ' '.join( e[ 'operands'] )))
    230230            else:
    231                 print "%s   |-<%s> %s" % ( pfxs, idx, e['type'] )
     231                print("%s   |-<%s> %s" % ( pfxs, idx, e['type'] ))
    232232                self.print_table( e, pfxs + '   |' )
    233233
  • trunk/Source/JavaScriptCore/disassembler/udis86/ud_optable.py

    r120745 r154521  
    5151                ven = ( def_node.firstChild.data );
    5252            else:
    53                 print "warning: invalid node - %s" % def_node.localName
     53                print("warning: invalid node - %s" % def_node.localName)
    5454                continue
    5555        return ( pfx, opc, opr, ven )
     
    6666                continue
    6767            if insnNode.localName != "instruction":
    68                 print "warning: invalid insn node - %s" % insnNode.localName
     68                print("warning: invalid insn node - %s" % insnNode.localName)
    6969                continue
    7070
     
    8585
    8686def printFn( pfx, mnm, opc, opr, ven ):
    87     print 'def: ',
     87    print('def: '),
    8888    if len( pfx ):
    89         print ' '.join( pfx ),
    90     print "%s %s %s %s" % \
    91             ( mnm, ' '.join( opc ), ' '.join( opr ), ven )
     89        print(' '.join( pfx )),
     90    print("%s %s %s %s" % \
     91            ( mnm, ' '.join( opc ), ' '.join( opr ), ven ))
    9292
    9393
Note: See TracChangeset for help on using the changeset viewer.