summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-04-27 18:40:21 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-04-27 18:40:21 (GMT)
commitf19a7b90bd0cbdf40d02f125db3e39f077f3a89f (patch)
treec5ec7d4eb8e528e91715cccab39590324ca0327c /Python
parentfe4948bcefe247ca69e3d605eac1d9d4985e4cfd (diff)
downloadcpython-f19a7b90bd0cbdf40d02f125db3e39f077f3a89f.zip
cpython-f19a7b90bd0cbdf40d02f125db3e39f077f3a89f.tar.gz
cpython-f19a7b90bd0cbdf40d02f125db3e39f077f3a89f.tar.bz2
A little reformating of Py3k warnings
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c12
-rw-r--r--Python/ceval.c16
-rw-r--r--Python/sysmodule.c2
3 files changed, 15 insertions, 15 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 5d191a6..9f9b75a 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -166,7 +166,7 @@ builtin_apply(PyObject *self, PyObject *args)
PyObject *t = NULL, *retval = NULL;
if (PyErr_WarnPy3k("apply() not supported in 3.x; "
- "use func(*args, **kwargs)", 1) < 0)
+ "use func(*args, **kwargs)", 1) < 0)
return NULL;
if (!PyArg_UnpackTuple(args, "apply", 1, 3, &func, &alist, &kwdict))
@@ -224,7 +224,7 @@ static PyObject *
builtin_callable(PyObject *self, PyObject *v)
{
if (PyErr_WarnPy3k("callable() not supported in 3.x; "
- "use hasattr(o, '__call__')", 1) < 0)
+ "use hasattr(o, '__call__')", 1) < 0)
return NULL;
return PyBool_FromLong((long)PyCallable_Check(v));
}
@@ -704,7 +704,7 @@ builtin_execfile(PyObject *self, PyObject *args)
int exists;
if (PyErr_WarnPy3k("execfile() not supported in 3.x; use exec()",
- 1) < 0)
+ 1) < 0)
return NULL;
if (!PyArg_ParseTuple(args, "s|O!O:execfile",
@@ -931,7 +931,7 @@ builtin_map(PyObject *self, PyObject *args)
if (func == Py_None) {
if (PyErr_WarnPy3k("map(None, ...) not supported in 3.x; "
- "use list(...)", 1) < 0)
+ "use list(...)", 1) < 0)
return NULL;
if (n == 1) {
/* map(None, S) is the same as list(S). */
@@ -1959,7 +1959,7 @@ builtin_reduce(PyObject *self, PyObject *args)
PyObject *seq, *func, *result = NULL, *it;
if (PyErr_WarnPy3k("reduce() not supported in 3.x; "
- "use functools.reduce()", 1) < 0)
+ "use functools.reduce()", 1) < 0)
return NULL;
if (!PyArg_UnpackTuple(args, "reduce", 2, 3, &func, &seq, &result))
@@ -2035,7 +2035,7 @@ static PyObject *
builtin_reload(PyObject *self, PyObject *v)
{
if (PyErr_WarnPy3k("In 3.x, reload() is renamed to imp.reload()",
- 1) < 0)
+ 1) < 0)
return NULL;
return PyImport_ReloadModule(v);
diff --git a/Python/ceval.c b/Python/ceval.c
index c085851..0cff157 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3157,16 +3157,16 @@ do_raise(PyObject *type, PyObject *value, PyObject *tb)
/* Not something you can raise. You get an exception
anyway, just not what you specified :-) */
PyErr_Format(PyExc_TypeError,
- "exceptions must be classes or instances, not %s",
- type->ob_type->tp_name);
+ "exceptions must be classes or instances, not %s",
+ type->ob_type->tp_name);
goto raise_error;
}
assert(PyExceptionClass_Check(type));
if (Py_Py3kWarningFlag && PyClass_Check(type)) {
if (PyErr_WarnEx(PyExc_DeprecationWarning,
- "exceptions must derive from BaseException "
- "in 3.x", 1) == -1)
+ "exceptions must derive from BaseException "
+ "in 3.x", 1) < 0)
goto raise_error;
}
@@ -4092,7 +4092,7 @@ cmp_outcome(int op, register PyObject *v, register PyObject *w)
PyExc_DeprecationWarning,
"catching of string "
"exceptions is deprecated", 1);
- if (ret_val == -1)
+ if (ret_val < 0)
return NULL;
}
else if (Py_Py3kWarningFlag &&
@@ -4103,7 +4103,7 @@ cmp_outcome(int op, register PyObject *v, register PyObject *w)
ret_val = PyErr_WarnEx(
PyExc_DeprecationWarning,
CANNOT_CATCH_MSG, 1);
- if (ret_val == -1)
+ if (ret_val < 0)
return NULL;
}
}
@@ -4115,7 +4115,7 @@ cmp_outcome(int op, register PyObject *v, register PyObject *w)
PyExc_DeprecationWarning,
"catching of string "
"exceptions is deprecated", 1);
- if (ret_val == -1)
+ if (ret_val < 0)
return NULL;
}
else if (Py_Py3kWarningFlag &&
@@ -4126,7 +4126,7 @@ cmp_outcome(int op, register PyObject *v, register PyObject *w)
ret_val = PyErr_WarnEx(
PyExc_DeprecationWarning,
CANNOT_CATCH_MSG, 1);
- if (ret_val == -1)
+ if (ret_val < 0)
return NULL;
}
}
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 83d7d68..a9ab6a7 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -173,7 +173,7 @@ sys_exc_clear(PyObject *self, PyObject *noargs)
PyObject *tmp_type, *tmp_value, *tmp_tb;
if (PyErr_WarnPy3k("sys.exc_clear() not supported in 3.x; "
- "use except clauses", 1) < 0)
+ "use except clauses", 1) < 0)
return NULL;
tstate = PyThreadState_GET();