Skip to content

Commit c10e111

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d4b888b commit c10e111

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/attr/_make.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -786,17 +786,14 @@ def __init__(
786786
# BaseException.__reduce__ returns (cls, self.args, state) which calls
787787
# cls(*args) on unpickle, but kw_only attrs reject positional args.
788788
# Override __reduce__ to use __new__ + state instead of __init__.
789-
if props.is_exception and any(
790-
a.kw_only for a in attrs if a.init
791-
):
789+
if props.is_exception and any(a.kw_only for a in attrs if a.init):
792790
_attr_names = self._attr_names
793791

794792
def __reduce__(self, *, _attr_names=_attr_names):
795793
state = {
796794
name: getattr(self, name)
797795
for name in _attr_names
798-
if name != "__weakref__"
799-
and hasattr(self, name)
796+
if name != "__weakref__" and hasattr(self, name)
800797
}
801798
return (_rebuild_exc, (self.__class__, state))
802799

0 commit comments

Comments
 (0)