From 6d609db8c052d30ecf7386228d0c8c81167a4324 Mon Sep 17 00:00:00 2001 From: Rob Percival Date: Tue, 4 Jul 2023 16:14:10 +0100 Subject: [PATCH] Simplify props.py It had code for handling the differences between old-style and new-style classes in Python 2, but support for Python 2 was dropped long ago. --- graphene/utils/props.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/graphene/utils/props.py b/graphene/utils/props.py index 26c697eca..e6d01cb91 100644 --- a/graphene/utils/props.py +++ b/graphene/utils/props.py @@ -1,15 +1,11 @@ -class _OldClass: +class _Class: pass -class _NewClass: - pass - - -_all_vars = set(dir(_OldClass) + dir(_NewClass)) +_built_in_vars = set(dir(_Class)) def props(x): return { - key: vars(x).get(key, getattr(x, key)) for key in dir(x) if key not in _all_vars + key: vars(x).get(key, getattr(x, key)) for key in dir(x) if key not in _built_in_vars }