diff options
| author | Charles Harris <charlesr.harris@gmail.com> | 2018-10-26 09:31:22 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-26 09:31:22 -0500 |
| commit | 763be37f77b572f46637db4032cebfd0f96175d9 (patch) | |
| tree | d71728910c28cb5881b1daa4572dec48f00a8b19 /numpy/core/_internal.py | |
| parent | 437534b06bf7ccd744170accd4283f39eeb26e57 (diff) | |
| parent | 0709d92f78cc6e78ba79da9a25627db87059b31d (diff) | |
| download | numpy-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.py | 6 |
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: |
