[Python-checkins] gh-107910: Remove not needing newline in error message (GH-107928)

serhiy-storchaka webhook-mailer at python.org
Mon Aug 14 05:26:22 EDT 2023


https://github.com/python/cpython/commit/c3887b57a75a105615dd555aaf74e6c9a243ebdd
commit: c3887b57a75a105615dd555aaf74e6c9a243ebdd
branch: main
author: Joon Hwan 김준환 <xncbf12 at gmail.com>
committer: serhiy-storchaka <storchaka at gmail.com>
date: 2023-08-14T12:26:18+03:00
summary:

gh-107910: Remove not needing newline in error message (GH-107928)

files:
M Lib/test/test_descr.py
M Objects/typeobject.c

diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index ad3eefba36585..fc8d0a305d8da 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -989,8 +989,8 @@ class EditableScrollablePane(ScrollablePane,EditablePane): pass
 
     def test_mro_disagreement(self):
         # Testing error messages for MRO disagreement...
-        mro_err_msg = """Cannot create a consistent method resolution
-order (MRO) for bases """
+        mro_err_msg = ("Cannot create a consistent method resolution "
+                       "order (MRO) for bases ")
 
         def raises(exc, expected, callable, *args):
             try:
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 030e8bfc99b6d..7ce3de4d58d0d 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2444,7 +2444,7 @@ set_mro_error(PyObject **to_merge, Py_ssize_t to_merge_size, int *remain)
     n = PyDict_GET_SIZE(set);
 
     off = PyOS_snprintf(buf, sizeof(buf), "Cannot create a \
-consistent method resolution\norder (MRO) for bases");
+consistent method resolution order (MRO) for bases");
     i = 0;
     while (PyDict_Next(set, &i, &k, &v) && (size_t)off < sizeof(buf)) {
         PyObject *name = class_name(k);



More information about the Python-checkins mailing list