summaryrefslogtreecommitdiffstats
path: root/Objects/typeobject.c
diff options
context:
space:
mode:
authorEric V. Smith <eric@trueblade.com>2011-03-12 15:08:48 (GMT)
committerEric V. Smith <eric@trueblade.com>2011-03-12 15:08:48 (GMT)
commitb9cd3531c42265f3063a7d202891a7497eb43130 (patch)
tree5dbf0827151b1dcd51775038edfa3f82d9b6daab /Objects/typeobject.c
parente4f6a80ed843ac68ffbd1599d1dc0c55362df205 (diff)
downloadcpython-b9cd3531c42265f3063a7d202891a7497eb43130.zip
cpython-b9cd3531c42265f3063a7d202891a7497eb43130.tar.gz
cpython-b9cd3531c42265f3063a7d202891a7497eb43130.tar.bz2
Issue 9856: Change object.__format__ with a non-empty format string from a PendingDeprecationWarning to a DeprecationWarning.
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r--Objects/typeobject.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index efeaa9d..91a8a8b 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3401,21 +3401,21 @@ object_format(PyObject *self, PyObject *args)
self_as_str = PyObject_Str(self);
if (self_as_str != NULL) {
/* Issue 7994: If we're converting to a string, we
- should reject format specifications */
+ should reject format specifications */
if (PyUnicode_GET_SIZE(format_spec) > 0) {
- if (PyErr_WarnEx(PyExc_PendingDeprecationWarning,
- "object.__format__ with a non-empty format "
- "string is deprecated", 1) < 0) {
- goto done;
- }
- /* Eventually this will become an error:
- PyErr_Format(PyExc_TypeError,
- "non-empty format string passed to object.__format__");
- goto done;
- */
- }
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "object.__format__ with a non-empty format "
+ "string is deprecated", 1) < 0) {
+ goto done;
+ }
+ /* Eventually this will become an error:
+ PyErr_Format(PyExc_TypeError,
+ "non-empty format string passed to object.__format__");
+ goto done;
+ */
+ }
- result = PyObject_Format(self_as_str, format_spec);
+ result = PyObject_Format(self_as_str, format_spec);
}
done: