summaryrefslogtreecommitdiffstats
path: root/Objects
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 /Objects
parentfe4948bcefe247ca69e3d605eac1d9d4985e4cfd (diff)
downloadcpython-f19a7b90bd0cbdf40d02f125db3e39f077f3a89f.zip
cpython-f19a7b90bd0cbdf40d02f125db3e39f077f3a89f.tar.gz
cpython-f19a7b90bd0cbdf40d02f125db3e39f077f3a89f.tar.bz2
A little reformating of Py3k warnings
Diffstat (limited to 'Objects')
-rw-r--r--Objects/cellobject.c2
-rw-r--r--Objects/codeobject.c4
-rw-r--r--Objects/dictobject.c4
-rw-r--r--Objects/exceptions.c10
-rw-r--r--Objects/fileobject.c5
-rw-r--r--Objects/listobject.c2
-rw-r--r--Objects/methodobject.c7
7 files changed, 16 insertions, 18 deletions
diff --git a/Objects/cellobject.c b/Objects/cellobject.c
index e2a8d29..4e0bcf8 100644
--- a/Objects/cellobject.c
+++ b/Objects/cellobject.c
@@ -56,7 +56,7 @@ cell_compare(PyCellObject *a, PyCellObject *b)
{
/* Py3K warning for comparisons */
if (PyErr_WarnPy3k("cell comparisons not supported in 3.x",
- 1) < 0) {
+ 1) < 0) {
return -2;
}
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 815135d..e94b4cc 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -339,9 +339,9 @@ code_richcompare(PyObject *self, PyObject *other, int op)
!PyCode_Check(other)) {
/* Py3K warning if types are not equal and comparison
- isn't == or != */
+ isn't == or != */
if (PyErr_WarnPy3k("code inequality comparisons not supported "
- "in 3.x", 1) < 0) {
+ "in 3.x", 1) < 0) {
return NULL;
}
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 2291524..102ea98 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -1779,7 +1779,7 @@ dict_richcompare(PyObject *v, PyObject *w, int op)
else {
/* Py3K warning if comparison isn't == or != */
if (PyErr_WarnPy3k("dict inequality comparisons not supported "
- "in 3.x", 1) < 0) {
+ "in 3.x", 1) < 0) {
return NULL;
}
res = Py_NotImplemented;
@@ -1810,7 +1810,7 @@ static PyObject *
dict_has_key(register PyDictObject *mp, PyObject *key)
{
if (PyErr_WarnPy3k("dict.has_key() not supported in 3.x; "
- "use the in operator", 1) < 0)
+ "use the in operator", 1) < 0)
return NULL;
return dict_contains(mp, key);
}
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 4a9eba1..48b47b0 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -279,9 +279,8 @@ BaseException_get_message(PyBaseExceptionObject *self)
int ret;
ret = PyErr_WarnEx(PyExc_DeprecationWarning,
"BaseException.message has been deprecated as "
- "of Python 2.6",
- 1);
- if (ret == -1)
+ "of Python 2.6", 1);
+ if (ret < 0)
return NULL;
Py_INCREF(self->message);
@@ -294,9 +293,8 @@ BaseException_set_message(PyBaseExceptionObject *self, PyObject *val)
int ret;
ret = PyErr_WarnEx(PyExc_DeprecationWarning,
"BaseException.message has been deprecated as "
- "of Python 2.6",
- 1);
- if (ret == -1)
+ "of Python 2.6", 1);
+ if (ret < 0)
return -1;
Py_INCREF(val);
Py_DECREF(self->message);
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index ef03232..40ea944 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -627,8 +627,9 @@ file_seek(PyFileObject *f, PyObject *args)
return NULL;
/* Deprecated in 2.6 */
PyErr_Clear();
- if (PyErr_Warn(PyExc_DeprecationWarning,
- "integer argument expected, got float"))
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "integer argument expected, got float",
+ 1) < 0)
return NULL;
off_index = offobj;
Py_INCREF(offobj);
diff --git a/Objects/listobject.c b/Objects/listobject.c
index e4e8ae4..ee2fda1 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2038,7 +2038,7 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
if (compare == Py_None)
compare = NULL;
if (compare != NULL &&
- PyErr_WarnPy3k("the cmp argument is not supported in 3.x", 1) < 0)
+ PyErr_WarnPy3k("the cmp argument is not supported in 3.x", 1) < 0)
return NULL;
if (keyfunc == Py_None)
keyfunc = NULL;
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 240cc05..737a3f7 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -236,7 +236,7 @@ meth_richcompare(PyObject *self, PyObject *other, int op)
{
/* Py3K warning if types are not equal and comparison isn't == or != */
if (PyErr_WarnPy3k("builtin_function_or_method inequality "
- "comparisons not supported in 3.x", 1) < 0) {
+ "comparisons not supported in 3.x", 1) < 0) {
return NULL;
}
@@ -352,9 +352,8 @@ Py_FindMethodInChain(PyMethodChain *chain, PyObject *self, const char *name)
{
if (name[0] == '_' && name[1] == '_') {
if (strcmp(name, "__methods__") == 0) {
- if (Py_Py3kWarningFlag &&
- PyErr_Warn(PyExc_DeprecationWarning,
- "__methods__ not supported in 3.x") < 0)
+ if (PyErr_WarnPy3k("__methods__ not supported in 3.x",
+ 1) < 0)
return NULL;
return listmethodchain(chain);
}