From: Mike Bayer Date: Sun, 27 Sep 2020 15:06:48 +0000 (-0400) Subject: Repair erroneous "future" symbol X-Git-Tag: rel_1_4_0b1~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8a665b23062dbd90e4e813655a568f00c94ef685;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Repair erroneous "future" symbol the change in 1e800285508ecd869c6874fed failed to fully remove the "future" symbol which then got confused against the import of the "future" package itself, which is also not needed. remove it entirely. pin pytest < 6.1 to see if new error condition may be avoided Change-Id: Ibe45040120d3772c39faef4a61ed26f90b60c79e --- diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 2574e2bbde..bebe015f74 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -29,7 +29,6 @@ from .base import state_str from .unitofwork import UOWTransaction from .. import engine from .. import exc as sa_exc -from .. import future from .. import sql from .. import util from ..inspection import inspect @@ -124,7 +123,6 @@ class ORMExecuteState(util.MemoizedSlots): "_compile_state_cls", "_starting_event_idx", "_events_todo", - "_future", "_update_execution_options", ) @@ -137,7 +135,6 @@ class ORMExecuteState(util.MemoizedSlots): bind_arguments, compile_state_cls, events_todo, - future, ): self.session = session self.statement = statement @@ -149,7 +146,6 @@ class ORMExecuteState(util.MemoizedSlots): self.bind_arguments = bind_arguments self._compile_state_cls = compile_state_cls self._events_todo = list(events_todo) - self._future = future def _remaining_events(self): return self._events_todo[self._starting_event_idx + 1 :] @@ -1504,7 +1500,7 @@ class Session(_SessionClassMethods): elif not bind_arguments: bind_arguments = {} - if future and ( + if ( statement._propagate_attrs.get("compile_state_plugin", None) == "orm" ): @@ -1551,7 +1547,6 @@ class Session(_SessionClassMethods): bind_arguments, compile_state_cls, events_todo, - future, ) for idx, fn in enumerate(events_todo): orm_exec_state._starting_event_idx = idx @@ -2117,7 +2112,7 @@ class Session(_SessionClassMethods): with_for_update = query.ForUpdateArg._from_argument(with_for_update) - stmt = future.select(object_mapper(instance)) + stmt = sql.select(object_mapper(instance)) if ( loading.load_on_ident( self, diff --git a/tox.ini b/tox.ini index aeef37b91e..d62db1c25c 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ install_command=python -m pip install {env:TOX_PIP_OPTS:} {opts} {packages} usedevelop= cov: True -deps=pytest!=3.9.1,!=3.9.2 +deps=pytest<6.1 pytest-xdist greenlet mock; python_version < '3.3'