Make Py3k warnings consistent w.r.t. punctuation; also respect the
EOL 80 limit and supply more alternatives in warning messages.
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 7fecb35..ec17bc2 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -190,10 +190,10 @@
BaseException_getitem(PyBaseExceptionObject *self, Py_ssize_t index)
{
if (Py_Py3kWarningFlag) {
- if (PyErr_Warn(PyExc_DeprecationWarning,
- "In 3.x, __getitem__ is not supported for exception "
- "classes, use args attribute") == -1)
- return NULL;
+ if (PyErr_Warn(PyExc_DeprecationWarning,
+ "__getitem__ not supported for exception "
+ "classes in 3.x; use args attribute") == -1)
+ return NULL;
}
return PySequence_GetItem(self->args, index);
}
@@ -203,10 +203,10 @@
Py_ssize_t start, Py_ssize_t stop)
{
if (Py_Py3kWarningFlag) {
- if (PyErr_Warn(PyExc_DeprecationWarning,
- "In 3.x, __getslice__ is not supported for exception "
- "classes, use args attribute") == -1)
- return NULL;
+ if (PyErr_Warn(PyExc_DeprecationWarning,
+ "__getslice__ not supported for exception "
+ "classes in 3.x; use args attribute") == -1)
+ return NULL;
}
return PySequence_GetSlice(self->args, start, stop);
}