Commit a7c449b8 authored by Sanyam Khurana's avatar Sanyam Khurana Committed by Nick Coghlan

bpo-30721: Add missing '?' to new error message (GH-3131)

parent f0202bb3
...@@ -161,14 +161,14 @@ class TestPy2MigrationHint(unittest.TestCase): ...@@ -161,14 +161,14 @@ class TestPy2MigrationHint(unittest.TestCase):
with self.assertRaises(TypeError) as context: with self.assertRaises(TypeError) as context:
print >> sys.stderr, "message" print >> sys.stderr, "message"
self.assertIn('Did you mean "print(<message>, ' self.assertIn('Did you mean "print(<message>, '
'file=<output_stream>)', str(context.exception)) 'file=<output_stream>)"?', str(context.exception))
# Test correct hint is produced in the case where RHS implements # Test correct hint is produced in the case where RHS implements
# __rrshift__ but returns NotImplemented # __rrshift__ but returns NotImplemented
with self.assertRaises(TypeError) as context: with self.assertRaises(TypeError) as context:
print >> 42 print >> 42
self.assertIn('Did you mean "print(<message>, ' self.assertIn('Did you mean "print(<message>, '
'file=<output_stream>)', str(context.exception)) 'file=<output_stream>)"?', str(context.exception))
# Test stream redirection hint is specific to print # Test stream redirection hint is specific to print
with self.assertRaises(TypeError) as context: with self.assertRaises(TypeError) as context:
......
...@@ -827,7 +827,7 @@ binary_op(PyObject *v, PyObject *w, const int op_slot, const char *op_name) ...@@ -827,7 +827,7 @@ binary_op(PyObject *v, PyObject *w, const int op_slot, const char *op_name)
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for %.100s: " "unsupported operand type(s) for %.100s: "
"'%.100s' and '%.100s'. Did you mean \"print(<message>, " "'%.100s' and '%.100s'. Did you mean \"print(<message>, "
"file=<output_stream>)\"", "file=<output_stream>)\"?",
op_name, op_name,
v->ob_type->tp_name, v->ob_type->tp_name,
w->ob_type->tp_name); w->ob_type->tp_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment