bpo-33018: Improve issubclass() error checking and message. (GH-5944)


This improves error message for situations when a non-class is
checked w.r.t. an abstract base class.
(cherry picked from commit 40472dd42de4f7265d456458cd13ad6894d736db)

Co-authored-by: jab <jab@users.noreply.github.com>
diff --git a/Lib/_py_abc.py b/Lib/_py_abc.py
index 6f42ef3..3c3aa8e 100644
--- a/Lib/_py_abc.py
+++ b/Lib/_py_abc.py
@@ -107,6 +107,8 @@
 
     def __subclasscheck__(cls, subclass):
         """Override for issubclass(subclass, cls)."""
+        if not isinstance(subclass, type):
+            raise TypeError('issubclass() arg 1 must be a class')
         # Check cache
         if subclass in cls._abc_cache:
             return True