summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-05-07 22:42:16 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-05-07 22:42:16 (GMT)
commit95283fb58951aaa0ee7cfefcbf8785f132819529 (patch)
treed92b15cadfa1d526d0e8fee7bbc9481234643a88 /Python/compile.c
parent2533d88a9cd2fc04e8b90788c5f17daef0d09cf3 (diff)
parent9e77f72fb2b247d7024e37a106ed2791bb7298d7 (diff)
downloadcpython-95283fb58951aaa0ee7cfefcbf8785f132819529.zip
cpython-95283fb58951aaa0ee7cfefcbf8785f132819529.tar.gz
cpython-95283fb58951aaa0ee7cfefcbf8785f132819529.tar.bz2
Merge 3.4
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Python/compile.c b/Python/compile.c
index bf4cf40..efd4807 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -202,7 +202,7 @@ static int compiler_set_qualname(struct compiler *);
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 @@ compiler_enter_scope(struct compiler *c, identifier name,
/* 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 @@ compiler_exit_scope(struct compiler *c)
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 @@ compiler_set_qualname(struct compiler *c)
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) {