[Python-checkins] bpo-44640: Improve punctuation consistency in isinstance/issubclass error messages (GH-27144) (GH-28436)

pablogsal webhook-mailer at python.org
Sun Sep 19 15:11:46 EDT 2021


https://github.com/python/cpython/commit/9c23a1ebade19f20c7d6e592a7d0329545a9a746
commit: 9c23a1ebade19f20c7d6e592a7d0329545a9a746
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: pablogsal <Pablogsal at gmail.com>
date: 2021-09-19T20:11:41+01:00
summary:

bpo-44640: Improve punctuation consistency in isinstance/issubclass error messages (GH-27144) (GH-28436)

Co-authored-by: Łukasz Langa <lukasz at langa.pl>
(cherry picked from commit f4813388b4506b2fafb0089848c5b11cd503758c)

Co-authored-by: wyz23x2 <52805709+wyz23x2 at users.noreply.github.com>

Co-authored-by: wyz23x2 <52805709+wyz23x2 at users.noreply.github.com>

files:
M Objects/abstract.c

diff --git a/Objects/abstract.c b/Objects/abstract.c
index 33eb8577a9be8..c056c6698850c 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2608,7 +2608,7 @@ object_isinstance(PyObject *inst, PyObject *cls)
     }
     else {
         if (!check_class(cls,
-            "isinstance() arg 2 must be a type, a tuple of types or a union"))
+            "isinstance() arg 2 must be a type, a tuple of types, or a union"))
             return -1;
         retval = _PyObject_LookupAttrId(inst, &PyId___class__, &icls);
         if (icls != NULL) {
@@ -2704,7 +2704,7 @@ recursive_issubclass(PyObject *derived, PyObject *cls)
 
     if (!_PyUnion_Check(cls) && !check_class(cls,
                             "issubclass() arg 2 must be a class,"
-                            " a tuple of classes, or a union.")) {
+                            " a tuple of classes, or a union")) {
         return -1;
     }
 



More information about the Python-checkins mailing list