Skip to content

Commit fa3bd56

Browse files
committed
DOC: only change tp_name on CPython [skip azp][skip actions][skip cirrus]
1 parent 7297f31 commit fa3bd56

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/source/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ class PyTypeObject(ctypes.Structure):
5252
]:
5353
typ = getattr(numpy, name)
5454
c_typ = PyTypeObject.from_address(id(typ))
55-
c_typ.tp_name = _name_cache[typ] = b"numpy." + name.encode('utf8')
56-
55+
if sys.implementation.name == 'cpython':
56+
c_typ.tp_name = _name_cache[typ] = b"numpy." + name.encode('utf8')
57+
else:
58+
# It is not guarenteed that the c_typ has this model on other
59+
# implementations
60+
_name_cache[typ] = b"numpy." + name.encode('utf8')
5761

5862
replace_scalar_type_names()
5963

0 commit comments

Comments
 (0)