From a7c449b8c08933deabcf329fb74ed1336f6db34f Mon Sep 17 00:00:00 2001 From: Sanyam Khurana Date: Fri, 18 Aug 2017 17:48:14 +0530 Subject: bpo-30721: Add missing '?' to new error message (GH-3131) --- Lib/test/test_print.py | 4 ++-- Objects/abstract.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_print.py b/Lib/test/test_print.py index 8099327..e6434fe 100644 --- a/Lib/test/test_print.py +++ b/Lib/test/test_print.py @@ -161,14 +161,14 @@ class TestPy2MigrationHint(unittest.TestCase): with self.assertRaises(TypeError) as context: print >> sys.stderr, "message" self.assertIn('Did you mean "print(, ' - 'file=)', str(context.exception)) + 'file=)"?', str(context.exception)) # Test correct hint is produced in the case where RHS implements # __rrshift__ but returns NotImplemented with self.assertRaises(TypeError) as context: print >> 42 self.assertIn('Did you mean "print(, ' - 'file=)', str(context.exception)) + 'file=)"?', str(context.exception)) # Test stream redirection hint is specific to print with self.assertRaises(TypeError) as context: diff --git a/Objects/abstract.c b/Objects/abstract.c index abd9795..66ac0e3 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -827,7 +827,7 @@ binary_op(PyObject *v, PyObject *w, const int op_slot, const char *op_name) PyErr_Format(PyExc_TypeError, "unsupported operand type(s) for %.100s: " "'%.100s' and '%.100s'. Did you mean \"print(, " - "file=)\"", + "file=)\"?", op_name, v->ob_type->tp_name, w->ob_type->tp_name); -- cgit v0.12