File tree 1 file changed +5
-5
lines changed
Filter options
numpy/core/src/multiarray 1 file changed +5
-5
lines changed
Original file line number Diff line number Diff line change @@ -100,11 +100,6 @@ array_format(PyArrayObject *self, PyObject *args)
100
100
if (!PyArg_ParseTuple (args , "O:__format__" , & format_spec ))
101
101
return NULL ;
102
102
103
- /* if len(format_spec) == 0 this function is equivalent to __str__ */
104
- if (PyUnicode_GET_LENGTH (format_spec ) == 0 )
105
- // use the builtin
106
- return PyObject_Str ((PyObject * )self );
107
-
108
103
/* 0d arrays - forward to the scalar type */
109
104
if (PyArray_NDIM (self ) == 0 ) {
110
105
PyObject * item = PyArray_ToScalar (PyArray_DATA (self ), self );
@@ -118,6 +113,11 @@ array_format(PyArrayObject *self, PyObject *args)
118
113
return res ;
119
114
}
120
115
116
+ /* if len(format_spec) == 0 this function is equivalent to __str__ */
117
+ if (PyUnicode_GET_LENGTH (format_spec ) == 0 )
118
+ // use the builtin
119
+ return PyObject_Str ((PyObject * )self );
120
+
121
121
/* nd arrays - forward to _default_array_format */
122
122
// ndim > 0
123
123
PyObject * format_func = NULL ;
You can’t perform that action at this time.
0 commit comments