]> granicus.if.org Git - clang/commitdiff
Portable Python script across Python version
authorSerge Guelton <sguelton@quarkslab.com>
Mon, 3 Dec 2018 12:41:35 +0000 (12:41 +0000)
committerSerge Guelton <sguelton@quarkslab.com>
Mon, 3 Dec 2018 12:41:35 +0000 (12:41 +0000)
Python3 does not support type destructuring in function parameters.

Differential Revision: https://reviews.llvm.org/D55198

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348129 91177308-0d34-0410-b5e6-96231b3b80d8

utils/ABITest/Enumeration.py
utils/ABITest/TypeGen.py

index eb53e1784efaa636fc9d6b45dac51e5acd01fa59..01830a38cdf229550da0ced879816aa44ce700ce 100644 (file)
@@ -46,7 +46,8 @@ aleph0 = Aleph0()
 def base(line):
     return line*(line+1)//2
 
-def pairToN((x,y)):
+def pairToN(pair):
+    x,y = pair
     line,index = x+y,y
     return base(line)+index
 
index 0768bb77ee390222d22a8965b2f8f7d663ddf900..8330340cd3df9936232428939ec41b6b153c85c0 100644 (file)
@@ -99,7 +99,8 @@ class RecordType(Type):
                             ' '.join(map(getField, self.fields)))
 
     def getTypedefDef(self, name, printer):
-        def getField((i, t)):
+        def getField(it):
+            i, t = it
             if t.isBitField():
                 if t.isPaddingBitField():
                     return '%s : 0;'%(printer.getTypeName(t),)