mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Implement PEP 393.
This commit is contained in:
parent
48d49497c5
commit
d63a3b8beb
102 changed files with 8153 additions and 5431 deletions
|
@ -2810,9 +2810,9 @@ PyMODINIT_FUNC
|
|||
PyInit_array(void)
|
||||
{
|
||||
PyObject *m;
|
||||
char buffer[PY_ARRAY_LENGTH(descriptors)], *p;
|
||||
PyObject *typecodes;
|
||||
Py_ssize_t size = 0;
|
||||
register Py_UNICODE *p;
|
||||
struct arraydescr *descr;
|
||||
|
||||
if (PyType_Ready(&Arraytype) < 0)
|
||||
|
@ -2831,13 +2831,13 @@ PyInit_array(void)
|
|||
size++;
|
||||
}
|
||||
|
||||
typecodes = PyUnicode_FromStringAndSize(NULL, size);
|
||||
p = PyUnicode_AS_UNICODE(typecodes);
|
||||
p = buffer;
|
||||
for (descr = descriptors; descr->typecode != '\0'; descr++) {
|
||||
*p++ = (char)descr->typecode;
|
||||
}
|
||||
typecodes = PyUnicode_DecodeASCII(buffer, p - buffer, NULL);
|
||||
|
||||
PyModule_AddObject(m, "typecodes", (PyObject *)typecodes);
|
||||
PyModule_AddObject(m, "typecodes", typecodes);
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
Py_DECREF(m);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue