[Python-checkins] cpython (merge 3.4 -> default): Merge 3.4
benjamin.peterson
python-checkins at python.org
Fri May 8 00:42:20 CEST 2015
https://hg.python.org/cpython/rev/1158f5d7a48e
changeset: 95909:1158f5d7a48e
parent: 95907:1ea01f2c5b10
parent: 95908:1556f2804456
user: Benjamin Peterson <benjamin at python.org>
date: Thu May 07 18:42:16 2015 -0400
summary:
Merge 3.4
files:
Python/compile.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/Python/compile.c b/Python/compile.c
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -202,7 +202,7 @@
static PyCodeObject *assemble(struct compiler *, int addNone);
static PyObject *__doc__;
-#define COMPILER_CAPSULE_NAME_COMPILER_UNIT "compile.c compiler unit"
+#define CAPSULE_NAME "compile.c compiler unit"
PyObject *
_Py_Mangle(PyObject *privateobj, PyObject *ident)
@@ -604,7 +604,7 @@
/* Push the old compiler_unit on the stack. */
if (c->u) {
- PyObject *capsule = PyCapsule_New(c->u, COMPILER_CAPSULE_NAME_COMPILER_UNIT, NULL);
+ PyObject *capsule = PyCapsule_New(c->u, CAPSULE_NAME, NULL);
if (!capsule || PyList_Append(c->c_stack, capsule) < 0) {
Py_XDECREF(capsule);
compiler_unit_free(u);
@@ -640,7 +640,7 @@
n = PyList_GET_SIZE(c->c_stack) - 1;
if (n >= 0) {
capsule = PyList_GET_ITEM(c->c_stack, n);
- c->u = (struct compiler_unit *)PyCapsule_GetPointer(capsule, COMPILER_CAPSULE_NAME_COMPILER_UNIT);
+ c->u = (struct compiler_unit *)PyCapsule_GetPointer(capsule, CAPSULE_NAME);
assert(c->u);
/* we are deleting from a list so this really shouldn't fail */
if (PySequence_DelItem(c->c_stack, n) < 0)
@@ -670,8 +670,7 @@
PyObject *mangled, *capsule;
capsule = PyList_GET_ITEM(c->c_stack, stack_size - 1);
- parent = (struct compiler_unit *)PyCapsule_GetPointer(
- capsule, COMPILER_CAPSULE_NAME_COMPILER_UNIT);
+ parent = (struct compiler_unit *)PyCapsule_GetPointer(capsule, CAPSULE_NAME);
assert(parent);
if (u->u_scope_type == COMPILER_SCOPE_FUNCTION || u->u_scope_type == COMPILER_SCOPE_CLASS) {
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list