]> granicus.if.org Git - python/commitdiff
bpo-30721: Add missing '?' to new error message (GH-3131)
authorSanyam Khurana <sanyam@sanyamkhurana.com>
Fri, 18 Aug 2017 12:18:14 +0000 (17:48 +0530)
committerNick Coghlan <ncoghlan@gmail.com>
Fri, 18 Aug 2017 12:18:14 +0000 (22:18 +1000)
Lib/test/test_print.py
Objects/abstract.c

index 80993279b8d0281938f4401fb6d6d09551f2125e..e6434feaf5eec66ebf49c4508164247f4aa043c1 100644 (file)
@@ -161,14 +161,14 @@ class TestPy2MigrationHint(unittest.TestCase):
         with self.assertRaises(TypeError) as context:
             print >> sys.stderr, "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
         # __rrshift__ but returns NotImplemented
         with self.assertRaises(TypeError) as context:
             print >> 42
         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
         with self.assertRaises(TypeError) as context:
index abd97953bd9edff2a0a5f62df82853dabac36f28..66ac0e3ea73760f4d61b35ca4c34426946873134 100644 (file)
@@ -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(<message>, "
-                "file=<output_stream>)\"",
+                "file=<output_stream>)\"?",
                 op_name,
                 v->ob_type->tp_name,
                 w->ob_type->tp_name);