Skip to content

Commit d876f78

Browse files
authored
Merge pull request #702 from wwwjfy/event-callback
compatibility fix for event callback
2 parents 57c4778 + 839ee1a commit d876f78

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/gino/schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,9 @@ async def _on_metadata_drop_async(self, target, bind, **kw):
399399

400400

401401
async def _call_portable_instancemethod(fn, args, kw):
402-
m = getattr(fn.target, fn.name + "_async", None)
402+
m = None
403+
if hasattr(fn, "target"):
404+
m = getattr(fn.target, fn.name + "_async", None)
403405
if m is None:
404406
return fn(*args, **kw)
405407
else:

0 commit comments

Comments
 (0)