summaryrefslogtreecommitdiffstats
path: root/Modules/arraymodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r--Modules/arraymodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 1d9a4f1..4f778a2 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -2307,7 +2307,8 @@ array_repr(arrayobject *a)
len = Py_SIZE(a);
typecode = a->ob_descr->typecode;
if (len == 0) {
- return PyUnicode_FromFormat("array('%c')", (int)typecode);
+ return PyUnicode_FromFormat("%s('%c')",
+ _PyType_Name(Py_TYPE(a)), (int)typecode);
}
if (typecode == 'u') {
v = array_array_tounicode_impl(a);
@@ -2317,7 +2318,8 @@ array_repr(arrayobject *a)
if (v == NULL)
return NULL;
- s = PyUnicode_FromFormat("array('%c', %R)", (int)typecode, v);
+ s = PyUnicode_FromFormat("%s('%c', %R)",
+ _PyType_Name(Py_TYPE(a)), (int)typecode, v);
Py_DECREF(v);
return s;
}