[PATCH] D56262: Python compat - isinstance(x, long)
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 3 06:17:28 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL350316: Python compat - test if type is integral (authored by serge_sans_paille, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D56262?vs=180026&id=180061#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56262/new/
https://reviews.llvm.org/D56262
Files:
llvm/trunk/bindings/python/llvm/tests/test_object.py
Index: llvm/trunk/bindings/python/llvm/tests/test_object.py
===================================================================
--- llvm/trunk/bindings/python/llvm/tests/test_object.py
+++ llvm/trunk/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 @@
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 @@
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 @@
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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56262.180061.patch
Type: text/x-patch
Size: 1977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190103/7fa87194/attachment.bin>
More information about the llvm-commits
mailing list