Skip to content

Commit

Permalink
compatibility fix for event callback
Browse files Browse the repository at this point in the history
for callbacks without sqlalchemy.util.portable_instancemethod wrapper
  • Loading branch information
wwwjfy committed Jun 20, 2020
1 parent 8131fb0 commit 7e07d1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gino/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,9 @@ async def _on_metadata_drop_async(self, target, bind, **kw):


async def _call_portable_instancemethod(fn, args, kw):
m = getattr(fn.target, fn.name + "_async", None)
m = None
if hasattr(fn, 'target'):
m = getattr(fn.target, fn.name + "_async", None)
if m is None:
return fn(*args, **kw)
else:
Expand Down

0 comments on commit 7e07d1e

Please sign in to comment.