diff Python/codecs.c @ 72510:b534b56379cb

Use the new Py_ARRAY_LENGTH macro
author Victor Stinner <victor.stinner@haypocalc.com>
date Thu, 29 Sep 2011 00:42:28 +0200
parents 8beaa9a37387
children 611c57aa694a
line wrap: on
line diff
--- a/Python/codecs.c	Thu Sep 29 00:39:24 2011 +0200
+++ b/Python/codecs.c	Thu Sep 29 00:42:28 2011 +0200
@@ -1044,7 +1044,7 @@
     interp->codec_error_registry = PyDict_New();
 
     if (interp->codec_error_registry) {
-        for (i = 0; i < sizeof(methods)/sizeof(methods[0]); ++i) {
+        for (i = 0; i < Py_ARRAY_LENGTH(methods); ++i) {
             PyObject *func = PyCFunction_New(&methods[i].def, NULL);
             int res;
             if (!func)