Skip to content

Commit

Permalink
chore: remove closing calls
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Sep 9, 2024
1 parent 0f09678 commit 009261a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ibis/backends/mysql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def from_connection(cls, con: pymysql.Connection) -> Backend:
return new_backend

def _post_connect(self) -> None:
with contextlib.closing(self.con.cursor()) as cur:
with self.con.cursor() as cur:
try:
cur.execute("SET @@session.time_zone = 'UTC'")
except Exception as e: # noqa: BLE001
Expand Down Expand Up @@ -269,7 +269,7 @@ def begin(self):
# from .execute()
@contextlib.contextmanager
def _safe_raw_sql(self, *args, **kwargs):
with contextlib.closing(self.raw_sql(*args, **kwargs)) as result:
with self.raw_sql(*args, **kwargs) as result:
yield result

def raw_sql(self, query: str | sg.Expression, **kwargs: Any) -> Any:
Expand Down

0 comments on commit 009261a

Please sign in to comment.