Skip to content

Commit 584a5cf

Browse files
authored
Merge pull request numpy#28483 from mattip/scalar_type_names
DOC: only change tp_name on CPython
2 parents 0dbee7e + fa3bd56 commit 584a5cf

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)