summaryrefslogtreecommitdiffstats
path: root/Lib/types.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/types.py')
-rw-r--r--Lib/types.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/Lib/types.py b/Lib/types.py
index 6110e6e..b4aa19c 100644
--- a/Lib/types.py
+++ b/Lib/types.py
@@ -165,14 +165,11 @@ def get_original_bases(cls, /):
assert get_original_bases(int) == (object,)
"""
try:
- return cls.__orig_bases__
+ return cls.__dict__.get("__orig_bases__", cls.__bases__)
except AttributeError:
- try:
- return cls.__bases__
- except AttributeError:
- raise TypeError(
- f'Expected an instance of type, not {type(cls).__name__!r}'
- ) from None
+ raise TypeError(
+ f"Expected an instance of type, not {type(cls).__name__!r}"
+ ) from None
class DynamicClassAttribute: