Skip to content

Commit

Permalink
Walrus again
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Apr 13, 2022
1 parent 473428e commit aac7a49
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 @@ -284,8 +284,9 @@ def is_union_type(obj):
)

def get_newtype_base(typ: Any) -> Optional[type]:
supertype = getattr(typ, "__supertype__", None)
if (
(supertype := getattr(typ, "__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 aac7a49

Please sign in to comment.