make qtdeclarative build with Python 3

Origin: OpenSUSE, https://build.opensuse.org/package/view_file/KDE:Qt:5.12/libqt5-qtdeclarative/qtdeclarative-switch-to-python3.patch
Forwarded: not-yet
Last-Update: 2020-01-01

Gbp-Pq: Name python3.patch
This commit is contained in:
Max Lin 2022-05-14 17:42:42 +08:00 committed by openKylinBot
parent df836d230c
commit 560a073886
2 changed files with 8 additions and 8 deletions

View File

@ -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" )

View File

@ -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: ', end='')
if len( pfx ):
print ' '.join( pfx ),
print "%s %s %s %s" % \
( mnm, ' '.join( opc ), ' '.join( opr ), ven )
print(' '.join( pfx ), end='')
print("%s %s %s %s" % \
( mnm, ' '.join( opc ), ' '.join( opr ), ven ))
def parse( xml, callback ):