summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-03-15 04:58:47 (GMT)
committerGuido van Rossum <guido@python.org>2006-03-15 04:58:47 (GMT)
commit45aecf451a64fb1ebe5e74d0b00965ac8d99dff6 (patch)
treea7edcfb45ceafcffde68a3542aeba67089ea81cb /Python/compile.c
parentf3175f6341ae207543a0d2d3be36c457349066e6 (diff)
downloadcpython-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.zip
cpython-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.tar.gz
cpython-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.tar.bz2
Checkpoint. 218 tests are okay; 53 are failing. Done so far:
- all classes are new-style (but ripping out classobject.[ch] isn't done) - int/int -> float - all exceptions must derive from BaseException - absolute import - 'as' and 'with' are keywords
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/Python/compile.c b/Python/compile.c
index baf3989..cfc6ef1 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2464,11 +2464,7 @@ compiler_import(struct compiler *c, stmt_ty s)
int r;
PyObject *level;
- if (c->c_flags && (c->c_flags->cf_flags & CO_FUTURE_ABSIMPORT))
- level = PyInt_FromLong(0);
- else
- level = PyInt_FromLong(-1);
-
+ level = PyInt_FromLong(0);
if (level == NULL)
return 0;
@@ -2511,12 +2507,7 @@ compiler_from_import(struct compiler *c, stmt_ty s)
if (!names)
return 0;
- if (s->v.ImportFrom.level == 0 && c->c_flags &&
- !(c->c_flags->cf_flags & CO_FUTURE_ABSIMPORT))
- level = PyInt_FromLong(-1);
- else
- level = PyInt_FromLong(s->v.ImportFrom.level);
-
+ level = PyInt_FromLong(s->v.ImportFrom.level);
if (!level) {
Py_DECREF(names);
return 0;
@@ -2746,10 +2737,7 @@ binop(struct compiler *c, operator_ty op)
case Mult:
return BINARY_MULTIPLY;
case Div:
- if (c->c_flags && c->c_flags->cf_flags & CO_FUTURE_DIVISION)
- return BINARY_TRUE_DIVIDE;
- else
- return BINARY_DIVIDE;
+ return BINARY_TRUE_DIVIDE;
case Mod:
return BINARY_MODULO;
case Pow:
@@ -2809,10 +2797,7 @@ inplace_binop(struct compiler *c, operator_ty op)
case Mult:
return INPLACE_MULTIPLY;
case Div:
- if (c->c_flags && c->c_flags->cf_flags & CO_FUTURE_DIVISION)
- return INPLACE_TRUE_DIVIDE;
- else
- return INPLACE_DIVIDE;
+ return INPLACE_TRUE_DIVIDE;
case Mod:
return INPLACE_MODULO;
case Pow: