From 95ae190ff329824019621b860cdfd048eeebe48d Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Tue, 27 Aug 2013 13:36:04 +0200 Subject: Failure building with python3 https://bugs.webkit.org/show_bug.cgi?id=106645 Patch by Laszlo Papp 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): Change-Id: Icec0024fc39bb342d23bbeefac4de0c81e176e6c git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154521 268f45cc-cd09-0410-ab3c-d52691b4dbfc Reviewed-by: Laszlo Papp Reviewed-by: Jocelyn Turcotte --- Source/JavaScriptCore/disassembler/udis86/itab.py | 4 ++-- Source/JavaScriptCore/disassembler/udis86/ud_opcode.py | 8 ++++---- Source/JavaScriptCore/disassembler/udis86/ud_optable.py | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'Source/JavaScriptCore/disassembler') diff --git a/Source/JavaScriptCore/disassembler/udis86/itab.py b/Source/JavaScriptCore/disassembler/udis86/itab.py index 07e20a6e1..3d50ad061 100644 --- a/Source/JavaScriptCore/disassembler/udis86/itab.py +++ b/Source/JavaScriptCore/disassembler/udis86/itab.py @@ -268,13 +268,13 @@ class UdItabGenerator( ud_opcode.UdOpcodeTables ): opr = e[ 'operands' ] for i in range(len(opr)): if not (opr[i] in self.OperandDict.keys()): - print "error: invalid operand declaration: %s\n" % opr[i] + print("error: invalid operand declaration: %s\n" % opr[i]) opr_c[i] = "O_" + opr[i] opr = "%s %s %s" % (opr_c[0] + ",", opr_c[1] + ",", opr_c[2]) for p in e['prefixes']: if not ( p in self.PrefixDict.keys() ): - print "error: invalid prefix specification: %s \n" % pfx + print("error: invalid prefix specification: %s \n" % pfx) pfx_c.append( self.PrefixDict[p] ) if len(e['prefixes']) == 0: pfx_c.append( "P_none" ) diff --git a/Source/JavaScriptCore/disassembler/udis86/ud_opcode.py b/Source/JavaScriptCore/disassembler/udis86/ud_opcode.py index f301b5246..f82738062 100644 --- a/Source/JavaScriptCore/disassembler/udis86/ud_opcode.py +++ b/Source/JavaScriptCore/disassembler/udis86/ud_opcode.py @@ -218,17 +218,17 @@ class UdOpcodeTables: self.parse(self.OpcodeTable0, insn) def print_table( self, table, pfxs ): - print "%s |" % pfxs + print("%s |" % pfxs) keys = table[ 'entries' ].keys() if ( len( keys ) ): keys.sort() for idx in keys: e = table[ 'entries' ][ idx ] if e[ 'type' ] == 'insn': - print "%s |-<%s>" % ( pfxs, idx ), - print "%s %s" % ( e[ 'mnemonic' ], ' '.join( e[ 'operands'] ) ) + print("%s |-<%s>" % ( pfxs, idx )), + print("%s %s" % ( e[ 'mnemonic' ], ' '.join( e[ 'operands'] ))) else: - print "%s |-<%s> %s" % ( pfxs, idx, e['type'] ) + print("%s |-<%s> %s" % ( pfxs, idx, e['type'] )) self.print_table( e, pfxs + ' |' ) def print_tree( self ): diff --git a/Source/JavaScriptCore/disassembler/udis86/ud_optable.py b/Source/JavaScriptCore/disassembler/udis86/ud_optable.py index 5b5c55d3b..0350643fd 100644 --- a/Source/JavaScriptCore/disassembler/udis86/ud_optable.py +++ b/Source/JavaScriptCore/disassembler/udis86/ud_optable.py @@ -50,7 +50,7 @@ class UdOptableXmlParser: elif def_node.localName == 'vendor': ven = ( def_node.firstChild.data ); else: - print "warning: invalid node - %s" % def_node.localName + print("warning: invalid node - %s" % def_node.localName) continue return ( pfx, opc, opr, ven ) @@ -65,7 +65,7 @@ class UdOptableXmlParser: if not insnNode.localName: continue if insnNode.localName != "instruction": - print "warning: invalid insn node - %s" % insnNode.localName + print("warning: invalid insn node - %s" % insnNode.localName) continue mnemonic = insnNode.getElementsByTagName( 'mnemonic' )[ 0 ].firstChild.data @@ -84,11 +84,11 @@ class UdOptableXmlParser: def printFn( pfx, mnm, opc, opr, ven ): - print 'def: ', + print('def: '), if len( pfx ): - print ' '.join( pfx ), - print "%s %s %s %s" % \ - ( mnm, ' '.join( opc ), ' '.join( opr ), ven ) + print(' '.join( pfx )), + print("%s %s %s %s" % \ + ( mnm, ' '.join( opc ), ' '.join( opr ), ven )) def parse( xml, callback ): -- cgit v1.2.1