Removed unused variables to improve code clarity and maintainability.
This change simplifies logic in `base.py`, `default.py`, and `result.py`.
No functionality was altered.
break
if sqlalchemy_exception and is_disconnect != ctx.is_disconnect:
- sqlalchemy_exception.connection_invalidated = is_disconnect = (
+ sqlalchemy_exception.connection_invalidated = (
ctx.is_disconnect
)
raise
def do_ping(self, dbapi_connection: DBAPIConnection) -> bool:
- cursor = None
-
cursor = dbapi_connection.cursor()
try:
cursor.execute(self._dialect_specific_select_one)
if self.is_crud or self.is_text:
result = self._setup_dml_or_text_result()
- yp = sr = False
+ yp = False
else:
yp = exec_opt.get("yield_per", None)
sr = self._is_server_side or exec_opt.get("stream_results", False)
"was required"
)
else:
- next_row = _NO_ROW
# if we checked for second row then that would have
# closed us :)
self._soft_close(hard=True)