]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Repair erroneous "future" symbol
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 27 Sep 2020 15:06:48 +0000 (11:06 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 27 Sep 2020 17:31:43 +0000 (13:31 -0400)
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

lib/sqlalchemy/orm/session.py
tox.ini

index 2574e2bbdee2e0b9776b2bc0710c8f2e7593d9d5..bebe015f74f28eb0198b17b121724e054799babb 100644 (file)
@@ -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 aeef37b91e7c28e65d699a2f51b7873d94b38cb7..d62db1c25ccf30202e63c1093e03b4cf03e321fe 100644 (file)
--- 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'