[llvm] r350316 - Python compat - test if type is integral

Serge Guelton via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 3 06:12:51 PST 2019


Author: serge_sans_paille
Date: Thu Jan  3 06:12:50 2019
New Revision: 350316

URL: http://llvm.org/viewvc/llvm-project?rev=350316&view=rev
Log:
Python compat - test if type is integral

Rely on numbers.Integral instead of int/long

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

Modified:
    llvm/trunk/bindings/python/llvm/tests/test_object.py

Modified: llvm/trunk/bindings/python/llvm/tests/test_object.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/python/llvm/tests/test_object.py?rev=350316&r1=350315&r2=350316&view=diff
==============================================================================
--- llvm/trunk/bindings/python/llvm/tests/test_object.py (original)
+++ llvm/trunk/bindings/python/llvm/tests/test_object.py Thu Jan  3 06:12:50 2019
@@ -1,3 +1,5 @@
+from numbers import Integral
+
 from .base import TestBase
 from ..object import ObjectFile
 from ..object import Relocation
@@ -20,9 +22,9 @@ class TestObjectFile(TestBase):
             count += 1
             assert isinstance(section, Section)
             assert isinstance(section.name, str)
-            assert isinstance(section.size, long)
+            assert isinstance(section.size, Integral)
             assert isinstance(section.contents, str)
-            assert isinstance(section.address, long)
+            assert isinstance(section.address, Integral)
             assert len(section.contents) == section.size
 
         self.assertGreater(count, 0)
@@ -38,8 +40,8 @@ class TestObjectFile(TestBase):
             count += 1
             assert isinstance(symbol, Symbol)
             assert isinstance(symbol.name, str)
-            assert isinstance(symbol.address, long)
-            assert isinstance(symbol.size, long)
+            assert isinstance(symbol.address, Integral)
+            assert isinstance(symbol.size, Integral)
 
         self.assertGreater(count, 0)
 
@@ -60,8 +62,8 @@ class TestObjectFile(TestBase):
         for section in o.get_sections():
             for relocation in section.get_relocations():
                 assert isinstance(relocation, Relocation)
-                assert isinstance(relocation.address, long)
-                assert isinstance(relocation.offset, long)
-                assert isinstance(relocation.type_number, long)
+                assert isinstance(relocation.address, Integral)
+                assert isinstance(relocation.offset, Integral)
+                assert isinstance(relocation.type_number, Integral)
                 assert isinstance(relocation.type_name, str)
                 assert isinstance(relocation.value_string, str)




More information about the llvm-commits mailing list