Skip to content

Commit

Permalink
Remove Python 2-specific code
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Mar 19, 2022
1 parent c0d54ce commit 5c920cf
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/attr/_make.py
Expand Up @@ -80,9 +80,6 @@ def __repr__(self):
def __bool__(self):
return False

def __len__(self):
return 0 # __bool__ for Python 2


NOTHING = _Nothing()
"""
Expand Down Expand Up @@ -1182,8 +1179,6 @@ def _determine_whether_to_implement(
whose presence signal that the user has implemented it themselves.
Return *default* if no reason for either for or against is found.
auto_detect must be False on Python 2.
"""
if flag is True or flag is False:
return flag
Expand Down Expand Up @@ -1487,10 +1482,6 @@ def attrs(
on_setattr = setters.pipe(*on_setattr)

def wrap(cls):

if getattr(cls, "__class__", None) is None:
raise TypeError("attrs only works with new-style classes.")

is_frozen = frozen or _has_frozen_base_class(cls)
is_exc = auto_exc is True and issubclass(cls, BaseException)
has_own_setattr = auto_detect and _has_own_attribute(
Expand Down

0 comments on commit 5c920cf

Please sign in to comment.