break
if sqlalchemy_exception and is_disconnect != ctx.is_disconnect:
- sqlalchemy_exception.connection_invalidated = is_disconnect = (
- ctx.is_disconnect
- )
+ sqlalchemy_exception.connection_invalidated = ctx.is_disconnect
if newraise:
raise newraise.with_traceback(exc_info[2]) from e
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)