Skip to content

Commit

Permalink
Walrus fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Apr 13, 2022
1 parent d36e8cf commit 473428e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cattrs/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ def is_union_type(obj):
)

def get_newtype_base(typ: Any) -> Optional[type]:
supertype = getattr(type, "__supertype__", None)
if (
(supertype := getattr(type, "__supertype__", None)) is not None
supertype is not None
and getattr(typ, "__qualname__", "") == "NewType.<locals>.new_type"
and typ.__module__ in ("typing", "typing_extensions")
):
Expand Down

0 comments on commit 473428e

Please sign in to comment.