[pypy-commit] pypy default: true is a keyword
mattip
noreply at buildbot.pypy.org
Wed Mar 26 22:21:47 CET 2014
Author: Matti Picus <matti.picus at gmail.com>
Branch:
Changeset: r70301:050293498791
Date: 2014-03-26 23:10 +0200
http://bitbucket.org/pypy/pypy/changeset/050293498791/
Log: true is a keyword
diff --git a/pypy/module/cpyext/test/test_cpyext.py b/pypy/module/cpyext/test/test_cpyext.py
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -642,30 +642,30 @@
body = """
static PyObject* foo_pi(PyObject* self, PyObject *args)
{
- PyObject *true = Py_True;
- int refcnt = true->ob_refcnt;
+ PyObject *true_obj = Py_True;
+ int refcnt = true_obj->ob_refcnt;
int refcnt_after;
- Py_INCREF(true);
- Py_INCREF(true);
- PyBool_Check(true);
- refcnt_after = true->ob_refcnt;
- Py_DECREF(true);
- Py_DECREF(true);
+ Py_INCREF(true_obj);
+ Py_INCREF(true_obj);
+ PyBool_Check(true_obj);
+ refcnt_after = true_obj->ob_refcnt;
+ Py_DECREF(true_obj);
+ Py_DECREF(true_obj);
fprintf(stderr, "REFCNT %i %i\\n", refcnt, refcnt_after);
return PyBool_FromLong(refcnt_after == refcnt+2 && refcnt < 3);
}
static PyObject* foo_bar(PyObject* self, PyObject *args)
{
- PyObject *true = Py_True;
+ PyObject *true_obj = Py_True;
PyObject *tup = NULL;
- int refcnt = true->ob_refcnt;
+ int refcnt = true_obj->ob_refcnt;
int refcnt_after;
tup = PyTuple_New(1);
- Py_INCREF(true);
- if (PyTuple_SetItem(tup, 0, true) < 0)
+ Py_INCREF(true_obj);
+ if (PyTuple_SetItem(tup, 0, true_obj) < 0)
return NULL;
- refcnt_after = true->ob_refcnt;
+ refcnt_after = true_obj->ob_refcnt;
Py_DECREF(tup);
fprintf(stderr, "REFCNT2 %i %i\\n", refcnt, refcnt_after);
return PyBool_FromLong(refcnt_after == refcnt);
More information about the pypy-commit
mailing list