summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorQiming Sun <osirpt.sun@gmail.com>2019-10-05 14:07:23 -0700
committerQiming Sun <osirpt.sun@gmail.com>2019-10-05 14:07:23 -0700
commit53dd7d6a706f5d9e93b41f714b46c6d32b085aec (patch)
treefb3fcc37a7647f56a9698645f034152f774aa195 /numpy
parent89564795fa9683a1aa49e31f1e086812a1acd5fa (diff)
downloadnumpy-53dd7d6a706f5d9e93b41f714b46c6d32b085aec.tar.gz
MAINT: Refer numpy issue #13808 to upstream CPython bug https://bugs.python.org/issue12836
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/_internal.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py
index 1cd6cd17f..5fd643505 100644
--- a/numpy/core/_internal.py
+++ b/numpy/core/_internal.py
@@ -278,7 +278,8 @@ class _ctypes(object):
# _ctypes.cast function causes a circular reference of self._data in
# self._data._objects. Attributes of self._data cannot be released
# until gc.collect is called. Make a copy of the pointer first then let
- # it hold the array reference.
+ # it hold the array reference. This is a workaround to circumvent the
+ # CPython bug https://bugs.python.org/issue12836
ptr = self._ctypes.cast(self._data, obj)
ptr._arr = self._arr
return ptr