summaryrefslogtreecommitdiff
path: root/numpy/core/_internal.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-10-26 09:31:22 -0500
committerGitHub <noreply@github.com>2018-10-26 09:31:22 -0500
commit763be37f77b572f46637db4032cebfd0f96175d9 (patch)
treed71728910c28cb5881b1daa4572dec48f00a8b19 /numpy/core/_internal.py
parent437534b06bf7ccd744170accd4283f39eeb26e57 (diff)
parent0709d92f78cc6e78ba79da9a25627db87059b31d (diff)
downloadnumpy-763be37f77b572f46637db4032cebfd0f96175d9.tar.gz
Merge pull request #12254 from eric-wieser/dtype-from-ctypes-type
MAINT: Move ctype -> dtype conversion to python
Diffstat (limited to 'numpy/core/_internal.py')
-rw-r--r--numpy/core/_internal.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py
index c4d967dc2..30069f0ca 100644
--- a/numpy/core/_internal.py
+++ b/numpy/core/_internal.py
@@ -796,13 +796,13 @@ def _ufunc_doc_signature_formatter(ufunc):
)
-def _is_from_ctypes(obj):
- # determine if an object comes from ctypes, in order to work around
+def npy_ctypes_check(cls):
+ # determine if a class comes from ctypes, in order to work around
# a bug in the buffer protocol for those objects, bpo-10746
try:
# ctypes class are new-style, so have an __mro__. This probably fails
# for ctypes classes with multiple inheritance.
- ctype_base = type(obj).__mro__[-2]
+ ctype_base = cls.__mro__[-2]
# right now, they're part of the _ctypes module
return 'ctypes' in ctype_base.__module__
except Exception: