diff options
| author | Brett Cannon <bcannon@gmail.com> | 2004-08-15 07:21:25 +0000 |
|---|---|---|
| committer | Brett Cannon <bcannon@gmail.com> | 2004-08-15 07:21:25 +0000 |
| commit | d0d4f2826dea9acf373f993449340574fabf2549 (patch) | |
| tree | a61dde626740eb5df6737517e4433020cf7ec0cc /Python | |
| parent | adc08a5b69c54c3dda7486cd74de123a4a802e29 (diff) | |
| download | cpython-d0d4f2826dea9acf373f993449340574fabf2549.tar.gz | |
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.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c index de29536528..79620c209f 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); |
