Skip to content

Commit

Permalink
fix: some edge case with __provides__ AttributeError
Browse files Browse the repository at this point in the history
  • Loading branch information
thorwhalen committed Jun 13, 2024
1 parent aecdb49 commit 77a0936
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dol/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,15 @@ def __reduce__(self):
) # don't bother adding attributes that the class already has
# set all the attributes
for attr in attrs:
if attr == '__provides__': # TODO: Hack. Find better solution.
# This is because __provides__ happened to be in wrapper_cls but not
# in wrapped.
# Happened at some point with `from sqldol import SqlRowsReader``
continue
wrapped_attr = getattr(wrapped, attr)
delegated_attribute = update_wrapper(
wrapper=DelegatedAttribute(delegation_attr, attr), wrapped=wrapped_attr,
wrapper=DelegatedAttribute(delegation_attr, attr),
wrapped=wrapped_attr,
)
setattr(Wrap, attr, delegated_attribute)

Expand Down

0 comments on commit 77a0936

Please sign in to comment.