diff Python/compile.c @ 33133:3db9a932775e legacy-trunk

Correct the order of application for decorators. Meant to be bottom-up and not top-down. Now matches the PEP.
author Brett Cannon <bcannon@gmail.com>
date Sun, 15 Aug 2004 07:21:25 +0000
parents e4992e930cb2
children 2e8d2bdd33de
line wrap: on
line diff
--- a/Python/compile.c	Sun Aug 15 01:15:01 2004 +0000
+++ b/Python/compile.c	Sun Aug 15 07:21:25 2004 +0000
@@ -4132,7 +4132,10 @@
 	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);