There was an error while loading. Please reload this page.
1 parent f0202bb commit a7c449bCopy full SHA for a7c449b
2 files changed
Lib/test/test_print.py
@@ -161,14 +161,14 @@ def test_stream_redirection_hint_for_py2_migration(self):
161
with self.assertRaises(TypeError) as context:
162
print >> sys.stderr, "message"
163
self.assertIn('Did you mean "print(<message>, '
164
- 'file=<output_stream>)', str(context.exception))
+ 'file=<output_stream>)"?', str(context.exception))
165
166
# Test correct hint is produced in the case where RHS implements
167
# __rrshift__ but returns NotImplemented
168
169
print >> 42
170
171
172
173
# Test stream redirection hint is specific to print
174
Objects/abstract.c
@@ -827,7 +827,7 @@ binary_op(PyObject *v, PyObject *w, const int op_slot, const char *op_name)
827
PyErr_Format(PyExc_TypeError,
828
"unsupported operand type(s) for %.100s: "
829
"'%.100s' and '%.100s'. Did you mean \"print(<message>, "
830
- "file=<output_stream>)\"",
+ "file=<output_stream>)\"?",
831
op_name,
832
v->ob_type->tp_name,
833
w->ob_type->tp_name);
0 commit comments