Skip to content

Commit 47b41d5

Browse files
committed
feat(async): make mixins async/sync compatible
1 parent 933b781 commit 47b41d5

File tree

2 files changed

+102
-65
lines changed

2 files changed

+102
-65
lines changed

gitlab/base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,16 @@ def _create_managers(self):
140140
self.__dict__[attr] = manager
141141

142142
def _update_attrs(self, new_attrs):
143+
if new_attrs is None:
144+
return
145+
143146
self.__dict__["_updated_attrs"] = {}
144147
self.__dict__["_attrs"].update(new_attrs)
145148

149+
async def _aupdate_attrs(self, new_attrs):
150+
new_attrs = await new_attrs
151+
self._update_attrs(new_attrs)
152+
146153
def get_id(self):
147154
"""Returns the id of the resource."""
148155
if self._id_attr is None or not hasattr(self, self._id_attr):

0 commit comments

Comments
 (0)