summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/ext/selectresults.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/ext/selectresults.py b/lib/sqlalchemy/ext/selectresults.py
index ec3ad8026..68538f3cb 100644
--- a/lib/sqlalchemy/ext/selectresults.py
+++ b/lib/sqlalchemy/ext/selectresults.py
@@ -7,7 +7,7 @@ class SelectResultsExt(orm.MapperExtension):
def select_by(self, query, *args, **params):
return SelectResults(query, query.join_by(*args, **params))
def select(self, query, arg=None, **kwargs):
- if hasattr(arg, '_selectable'):
+ if isinstance(arg, sql.FromClause) and arg.supports_execution():
return orm.EXT_PASS
else:
return SelectResults(query, arg, ops=kwargs)