File tree Expand file tree Collapse file tree 4 files changed +8
-14
lines changed Expand file tree Collapse file tree 4 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 7
7
from .scalar import ASCIIScalar # isort: skip
8
8
from ._asciidtype_main import ASCIIDType
9
9
10
-
11
- def _reconstruct_ASCIIDType (* args ):
12
- # this is needed for pickling instances because numpy overrides the pickling
13
- # behavior of the DTypeMeta class using copyreg. By pickling a wrapper
14
- # around the ASCIIDType initializer, we avoid triggering the code in numpy
15
- # that tries to handle pickling DTypeMeta instances. See
16
- # https://github.com/numpy/numpy/issues/23135#issuecomment-1410967842
17
- return ASCIIDType (* args )
18
-
19
-
20
- __all__ = ["ASCIIDType" , "ASCIIScalar" , "_reconstruct_ASCIIDType" ]
10
+ __all__ = [
11
+ "ASCIIDType" ,
12
+ "ASCIIScalar" ,
13
+ ]
Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ asciidtype__reduce__(ASCIIDTypeObject *self)
244
244
return NULL ;
245
245
}
246
246
247
- obj = PyObject_GetAttrString (mod , "_reconstruct_ASCIIDType " );
247
+ obj = PyObject_GetAttrString (mod , "ASCIIDType " );
248
248
Py_DECREF (mod );
249
249
if (obj == NULL ) {
250
250
Py_DECREF (ret );
Original file line number Diff line number Diff line change 5
5
from .scalar import StringScalar # isort: skip
6
6
from ._main import StringDType , _memory_usage
7
7
8
+
8
9
__all__ = [
9
10
"StringDType" ,
10
11
"StringScalar" ,
Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ stringdtype_repr(StringDTypeObject *NPY_UNUSED(self))
204
204
static int PICKLE_VERSION = 1 ;
205
205
206
206
static PyObject *
207
- stringdtype__reduce__ (StringDTypeObject * self )
207
+ stringdtype__reduce__ (StringDTypeObject * NPY_UNUSED ( self ) )
208
208
{
209
209
PyObject * ret , * mod , * obj , * state ;
210
210
@@ -219,7 +219,7 @@ stringdtype__reduce__(StringDTypeObject *self)
219
219
return NULL ;
220
220
}
221
221
222
- obj = PyObject_GetAttrString (mod , "_reconstruct_StringDType " );
222
+ obj = PyObject_GetAttrString (mod , "StringDType " );
223
223
Py_DECREF (mod );
224
224
if (obj == NULL ) {
225
225
Py_DECREF (ret );
You can’t perform that action at this time.
0 commit comments