Commit 9d5759df authored by Antoine Pitrou's avatar Antoine Pitrou

Merged revisions 82169 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82169 | antoine.pitrou | 2010-06-22 23:42:05 +0200 (mar., 22 juin 2010) | 4 lines

  Fix misindents in compile.c (for Benjamin).
  Of course, whoever used the wrong indentation rules needs to be spanked.
........
parent 62684e1a
...@@ -968,7 +968,7 @@ compiler_addop_o(struct compiler *c, int opcode, PyObject *dict, ...@@ -968,7 +968,7 @@ compiler_addop_o(struct compiler *c, int opcode, PyObject *dict,
{ {
int arg = compiler_add_o(c, dict, o); int arg = compiler_add_o(c, dict, o);
if (arg < 0) if (arg < 0)
return 0; return 0;
return compiler_addop_i(c, opcode, arg); return compiler_addop_i(c, opcode, arg);
} }
...@@ -979,11 +979,11 @@ compiler_addop_name(struct compiler *c, int opcode, PyObject *dict, ...@@ -979,11 +979,11 @@ compiler_addop_name(struct compiler *c, int opcode, PyObject *dict,
int arg; int arg;
PyObject *mangled = _Py_Mangle(c->u->u_private, o); PyObject *mangled = _Py_Mangle(c->u->u_private, o);
if (!mangled) if (!mangled)
return 0; return 0;
arg = compiler_add_o(c, dict, mangled); arg = compiler_add_o(c, dict, mangled);
Py_DECREF(mangled); Py_DECREF(mangled);
if (arg < 0) if (arg < 0)
return 0; return 0;
return compiler_addop_i(c, opcode, arg); return compiler_addop_i(c, opcode, arg);
} }
...@@ -1134,7 +1134,7 @@ static int ...@@ -1134,7 +1134,7 @@ static int
compiler_isdocstring(stmt_ty s) compiler_isdocstring(stmt_ty s)
{ {
if (s->kind != Expr_kind) if (s->kind != Expr_kind)
return 0; return 0;
return s->v.Expr.value->kind == Str_kind; return s->v.Expr.value->kind == Str_kind;
} }
...@@ -1240,11 +1240,11 @@ compiler_lookup_arg(PyObject *dict, PyObject *name) ...@@ -1240,11 +1240,11 @@ compiler_lookup_arg(PyObject *dict, PyObject *name)
PyObject *k, *v; PyObject *k, *v;
k = PyTuple_Pack(2, name, name->ob_type); k = PyTuple_Pack(2, name, name->ob_type);
if (k == NULL) if (k == NULL)
return -1; return -1;
v = PyDict_GetItem(dict, k); v = PyDict_GetItem(dict, k);
Py_DECREF(k); Py_DECREF(k);
if (v == NULL) if (v == NULL)
return -1; return -1;
return PyLong_AS_LONG(v); return PyLong_AS_LONG(v);
} }
...@@ -3073,7 +3073,7 @@ compiler_with(struct compiler *c, stmt_ty s) ...@@ -3073,7 +3073,7 @@ compiler_with(struct compiler *c, stmt_ty s)
block = compiler_new_block(c); block = compiler_new_block(c);
finally = compiler_new_block(c); finally = compiler_new_block(c);
if (!block || !finally) if (!block || !finally)
return 0; return 0;
/* Evaluate EXPR */ /* Evaluate EXPR */
VISIT(c, expr, s->v.With.context_expr); VISIT(c, expr, s->v.With.context_expr);
...@@ -3082,15 +3082,15 @@ compiler_with(struct compiler *c, stmt_ty s) ...@@ -3082,15 +3082,15 @@ compiler_with(struct compiler *c, stmt_ty s)
/* SETUP_WITH pushes a finally block. */ /* SETUP_WITH pushes a finally block. */
compiler_use_next_block(c, block); compiler_use_next_block(c, block);
if (!compiler_push_fblock(c, FINALLY_TRY, block)) { if (!compiler_push_fblock(c, FINALLY_TRY, block)) {
return 0; return 0;
} }
if (s->v.With.optional_vars) { if (s->v.With.optional_vars) {
VISIT(c, expr, s->v.With.optional_vars); VISIT(c, expr, s->v.With.optional_vars);
} }
else { else {
/* Discard result from context.__enter__() */ /* Discard result from context.__enter__() */
ADDOP(c, POP_TOP); ADDOP(c, POP_TOP);
} }
/* BLOCK code */ /* BLOCK code */
...@@ -3103,7 +3103,7 @@ compiler_with(struct compiler *c, stmt_ty s) ...@@ -3103,7 +3103,7 @@ compiler_with(struct compiler *c, stmt_ty s)
ADDOP_O(c, LOAD_CONST, Py_None, consts); ADDOP_O(c, LOAD_CONST, Py_None, consts);
compiler_use_next_block(c, finally); compiler_use_next_block(c, finally);
if (!compiler_push_fblock(c, FINALLY_END, finally)) if (!compiler_push_fblock(c, FINALLY_END, finally))
return 0; return 0;
/* Finally block starts; context.__exit__ is on the stack under /* Finally block starts; context.__exit__ is on the stack under
the exception or return information. Just issue our magic the exception or return information. Just issue our magic
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment