Skip to content

Commit 5c920cf

Browse files
committed
Remove Python 2-specific code
1 parent c0d54ce commit 5c920cf

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

src/attr/_make.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ def __repr__(self):
8080
def __bool__(self):
8181
return False
8282

83-
def __len__(self):
84-
return 0 # __bool__ for Python 2
85-
8683

8784
NOTHING = _Nothing()
8885
"""
@@ -1182,8 +1179,6 @@ def _determine_whether_to_implement(
11821179
whose presence signal that the user has implemented it themselves.
11831180
11841181
Return *default* if no reason for either for or against is found.
1185-
1186-
auto_detect must be False on Python 2.
11871182
"""
11881183
if flag is True or flag is False:
11891184
return flag
@@ -1487,10 +1482,6 @@ def attrs(
14871482
on_setattr = setters.pipe(*on_setattr)
14881483

14891484
def wrap(cls):
1490-
1491-
if getattr(cls, "__class__", None) is None:
1492-
raise TypeError("attrs only works with new-style classes.")
1493-
14941485
is_frozen = frozen or _has_frozen_base_class(cls)
14951486
is_exc = auto_exc is True and issubclass(cls, BaseException)
14961487
has_own_setattr = auto_detect and _has_own_attribute(

0 commit comments

Comments
 (0)