Skip to content

Commit 839ee1a

Browse files
committed
compatibility fix for event callback
for callbacks without sqlalchemy.util.portable_instancemethod wrapper
1 parent 8131fb0 commit 839ee1a

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)