Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba2cf07

Browse files
committed
Properly compute array size even for --disable-unicode.
1 parent 0073f2e commit ba2cf07

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/codecs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ void _PyCodecRegistry_Init(void)
822822
_PyCodec_ErrorRegistry = PyDict_New();
823823

824824
if (_PyCodec_ErrorRegistry) {
825-
for (i = 0; i < 5; ++i) {
825+
for (i = 0; i < sizeof(methods)/sizeof(methods[0]); ++i) {
826826
PyObject *func = PyCFunction_New(&methods[i].def, NULL);
827827
int res;
828828
if (!func)

0 commit comments

Comments
 (0)