From 42d799bb499da5f7bf94423324b413430436696d Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 19 Oct 2025 17:25:14 +0800 Subject: [PATCH] bugfix --- sqlor/sor.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sqlor/sor.py b/sqlor/sor.py index f73358c..4de17a9 100755 --- a/sqlor/sor.py +++ b/sqlor/sor.py @@ -239,11 +239,11 @@ class SQLor(object): async def cur_execute(self, cur, sql, ns): if inspect.iscoroutinefunction(cur.execute): ret = await cur.execute(sql, ns) - debug(f'-------coroutine--{ret}-{cur}----') + # debug(f'-------coroutine--{ret}-{cur}----') return ret f = awaitify(cur.execute) ret = await f(sql, ns) - debug(f'------function--{ret}------') + # debug(f'------function--{ret}------') return ret async def runVarSQL(self, cursor, sql, NS): @@ -309,10 +309,10 @@ class SQLor(object): async def fetchone(self, cur): if inspect.iscoroutinefunction(cur.fetchone): ret = await cur.fetchone() - debug(f'coro:sor.fetchone()={ret}, {type(ret)}') + # debug(f'coro:sor.fetchone()={ret}, {type(ret)}') return ret ret = await cur.fetchone() - debug(f'func:sor.fetchone()={ret}, {type(ret)}') + # debug(f'func:sor.fetchone()={ret}, {type(ret)}') if isinstance(ret, asyncio.Future): ret = ret.result() return ret @@ -334,7 +334,8 @@ class SQLor(object): fields = [i[0].lower() for i in cur.description] while True: rec = await self.fetchone(cur) - debug(f'{rec=}, {type(rec)}') + if rec is None: + break if rec is None: break if isinstance(rec, dict):