Skip to content

Commit

Permalink
feat: Adding python 3.11 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
awais786 committed Apr 28, 2024
1 parent 8d26c01 commit 2519dbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mongodb_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __getitem__(self, key):
Otherwise just return the attribute.
"""
item = self.proxied_object[key]
if hasattr(item, '__call__'):
if hasattr(item, '__call__') or attr.__class__.__name__ in ['Database']:
return MongoProxy(item, self.wait_time)
return item

Expand All @@ -103,7 +103,7 @@ def __getattr__(self, key):
that handles AutoReconnect exceptions. Otherwise wrap it in a MongoProxy object.
"""
attr = getattr(self.proxied_object, key)
if hasattr(attr, '__call__'):
if hasattr(attr, '__call__') or attr.__class__.__name__ in ['Database']:
attributes_for_class = self.methods_needing_retry.get(self.proxied_object.__class__, [])
if key in attributes_for_class:
return autoretry_read(self.wait_time)(attr)
Expand Down

0 comments on commit 2519dbe

Please sign in to comment.