diff Python/symtable.c @ 45447:393822f2ef90 legacy-trunk

Patch #1759: Backport of PEP 3129 class decorators with some help from Georg
author Christian Heimes <christian@cheimes.de>
date Sat, 23 Feb 2008 15:01:05 +0000
parents 6620a510e9a9
children fea7ba8910a9
line wrap: on
line diff
--- a/Python/symtable.c	Sat Feb 23 12:46:10 2008 +0000
+++ b/Python/symtable.c	Sat Feb 23 15:01:05 2008 +0000
@@ -931,8 +931,8 @@
 			return 0;
 		if (s->v.FunctionDef.args->defaults)
 			VISIT_SEQ(st, expr, s->v.FunctionDef.args->defaults);
-		if (s->v.FunctionDef.decorators)
-			VISIT_SEQ(st, expr, s->v.FunctionDef.decorators);
+		if (s->v.FunctionDef.decorator_list)
+			VISIT_SEQ(st, expr, s->v.FunctionDef.decorator_list);
 		if (!symtable_enter_block(st, s->v.FunctionDef.name, 
 					  FunctionBlock, (void *)s, s->lineno))
 			return 0;
@@ -946,6 +946,8 @@
 		if (!symtable_add_def(st, s->v.ClassDef.name, DEF_LOCAL))
 			return 0;
 		VISIT_SEQ(st, expr, s->v.ClassDef.bases);
+		if (s->v.ClassDef.decorator_list)
+			VISIT_SEQ(st, expr, s->v.ClassDef.decorator_list);
 		if (!symtable_enter_block(st, s->v.ClassDef.name, ClassBlock, 
 					  (void *)s, s->lineno))
 			return 0;