@@ -40,13 +40,13 @@ class NoResultError(Exception):
4040
4141async def maybe_create_tables (db ):
4242 try :
43- with ( await db .cursor () ) as cur :
43+ with await db .cursor () as cur :
4444 await cur .execute ("SELECT COUNT(*) FROM entries LIMIT 1" )
4545 await cur .fetchone ()
4646 except psycopg2 .ProgrammingError :
4747 with open ("schema.sql" ) as f :
4848 schema = f .read ()
49- with ( await db .cursor () ) as cur :
49+ with await db .cursor () as cur :
5050 await cur .execute (schema )
5151
5252
@@ -89,7 +89,7 @@ async def execute(self, stmt, *args):
8989
9090 Must be called with ``await self.execute(...)``
9191 """
92- with ( await self .application .db .cursor () ) as cur :
92+ with await self .application .db .cursor () as cur :
9393 await cur .execute (stmt , args )
9494
9595 async def query (self , stmt , * args ):
@@ -103,7 +103,7 @@ async def query(self, stmt, *args):
103103
104104 for row in await self.query(...)
105105 """
106- with ( await self .application .db .cursor () ) as cur :
106+ with await self .application .db .cursor () as cur :
107107 await cur .execute (stmt , args )
108108 return [self .row_to_obj (row , cur ) for row in await cur .fetchall ()]
109109
0 commit comments