[Python-checkins] r69657 - python/branches/io-c/Modules/_iobase.c

benjamin.peterson python-checkins at python.org
Mon Feb 16 00:46:07 CET 2009


Author: benjamin.peterson
Date: Mon Feb 16 00:46:07 2009
New Revision: 69657

Log:
use the correct macro

Modified:
   python/branches/io-c/Modules/_iobase.c

Modified: python/branches/io-c/Modules/_iobase.c
==============================================================================
--- python/branches/io-c/Modules/_iobase.c	(original)
+++ python/branches/io-c/Modules/_iobase.c	Mon Feb 16 00:46:07 2009
@@ -198,7 +198,7 @@
     PyErr_Fetch(&tp, &v, &tb);
     /* We need to resurrect the object as calling close() can invoke
        arbitrary code. */
-    ((PyObject *) self)->ob_refcnt++;
+    Py_REFCNT(self)++;
     /* The object could already be in an usable state, so we'll take any
        error as meaning "stop, nothing to see here". */
     /* XXX any Python method or property called from here may rely on
@@ -227,7 +227,7 @@
     if (dictptr != NULL)
         Py_CLEAR(*dictptr);
     PyErr_Restore(tp, v, tb);
-    if (--((PyObject *) self)->ob_refcnt != 0) {
+    if (--Py_REFCNT(self) != 0) {
         return -1;
     }
     return 0;


More information about the Python-checkins mailing list