[Python-checkins] cpython (merge 3.3 -> default): merge 3.3

benjamin.peterson python-checkins at python.org
Thu Nov 1 00:03:34 CET 2012


http://hg.python.org/cpython/rev/9c2df50b4fe0
changeset: 80142:9c2df50b4fe0
parent: 80121:1698d1ab0b0a
parent: 80141:6964a9b6c1ea
user: Benjamin Peterson <benjamin at python.org>
date: Wed Oct 31 19:01:48 2012 -0400
summary:
 merge 3.3
files:
 Python/symtable.c | 8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Python/symtable.c b/Python/symtable.c
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -1202,12 +1202,14 @@
 asdl_seq *seq = s->v.Global.names;
 for (i = 0; i < asdl_seq_LEN(seq); i++) {
 identifier name = (identifier)asdl_seq_GET(seq, i);
- char *c_name = _PyUnicode_AsString(name);
 long cur = symtable_lookup(st, name);
 if (cur < 0)
 return 0;
 if (cur & (DEF_LOCAL | USE)) {
 char buf[256];
+ char *c_name = _PyUnicode_AsString(name);
+ if (!c_name)
+ return 0;
 if (cur & DEF_LOCAL)
 PyOS_snprintf(buf, sizeof(buf),
 GLOBAL_AFTER_ASSIGN,
@@ -1229,12 +1231,14 @@
 asdl_seq *seq = s->v.Nonlocal.names;
 for (i = 0; i < asdl_seq_LEN(seq); i++) {
 identifier name = (identifier)asdl_seq_GET(seq, i);
- char *c_name = _PyUnicode_AsString(name);
 long cur = symtable_lookup(st, name);
 if (cur < 0)
 return 0;
 if (cur & (DEF_LOCAL | USE)) {
 char buf[256];
+ char *c_name = _PyUnicode_AsString(name);
+ if (!c_name)
+ return 0;
 if (cur & DEF_LOCAL)
 PyOS_snprintf(buf, sizeof(buf),
 NONLOCAL_AFTER_ASSIGN,
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /