summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 10c94e7fc0..47c57f48e1 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2329,8 +2329,9 @@ compiler_import_as(struct compiler *c, identifier name, identifier asname)
src = dot + 1;
while (dot) {
/* NB src is only defined when dot != NULL */
+ PyObject *attr;
dot = strchr(src, '.');
- PyObject *attr = PyString_FromStringAndSize(src,
+ attr = PyString_FromStringAndSize(src,
dot ? dot - src : strlen(src));
ADDOP_O(c, LOAD_ATTR, attr, names);
src = dot + 1;