summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2004-08-15 07:21:25 (GMT)
committerBrett Cannon <bcannon@gmail.com>2004-08-15 07:21:25 (GMT)
commitadd33601c2826a151718da295b15fbb8cf656e53 (patch)
tree5b06b8571dd84cba7d1d0da67143fd2f5a98b38b /Python
parent31f8350f439c3219c3975d127f8c5037d2362427 (diff)
downloadcpython-add33601c2826a151718da295b15fbb8cf656e53.zip
cpython-add33601c2826a151718da295b15fbb8cf656e53.tar.gz
cpython-add33601c2826a151718da295b15fbb8cf656e53.tar.bz2
Correct the order of application for decorators. Meant to be bottom-up and not
top-down. Now matches the PEP.
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index de29536..79620c2 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -4132,7 +4132,10 @@ com_decorators(struct compiling *c, node *n)
REQ(CHILD(n, nch - 1), NEWLINE);
ndecorators = 0;
- for (i = NCH(n) - 1; i >= 0; --i) {
+ /* the application order for decorators is the reverse of how they are
+ listed; bottom-up */
+ nch -= 1;
+ for (i = 0; i < nch; i+=1) {
node *ch = CHILD(n, i);
if (TYPE(ch) != NEWLINE) {
com_decorator(c, ch);