summaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorSerge Guelton <sguelton@quarkslab.com>2019-01-03 14:12:50 +0000
committerSerge Guelton <sguelton@quarkslab.com>2019-01-03 14:12:50 +0000
commit247f1c68c488b45d15aaf159c28b29e05abeb2dd (patch)
tree439babd87424bb8c0823589f35c040c831239b76 /bindings
parent9f3acd1159de6da53e8611c237b72933f1115188 (diff)
downloadllvm-247f1c68c488b45d15aaf159c28b29e05abeb2dd.tar.gz
Python compat - test if type is integral
Rely on numbers.Integral instead of int/long Differential Revision: https://reviews.llvm.org/D56262 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/llvm/tests/test_object.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/bindings/python/llvm/tests/test_object.py b/bindings/python/llvm/tests/test_object.py
index 3f92d8155b61..a45b7beec335 100644
--- a/bindings/python/llvm/tests/test_object.py
+++ b/bindings/python/llvm/tests/test_object.py
@@ -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)