diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-08-11 20:44:42 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-08-11 22:29:42 -0400 |
| commit | 3a542005a5f38556dc45c5bc8f256a154ee72c8a (patch) | |
| tree | c573e56e4a9ef86f8a429d2c677b5865cc0ebeed /lib/sqlalchemy/sql/visitors.py | |
| parent | f5e57f7c311288d892894edcc44d901b5bfbb3d1 (diff) | |
| download | sqlalchemy-3a542005a5f38556dc45c5bc8f256a154ee72c8a.tar.gz | |
Use compat.string_types to check for visit name string
Th visitor optimization looking for plain string needs to
accommodate for u"" in Python 2 due to the unicode_literals
future.
Fixes: #4800
Change-Id: I5e3136f2f2cbd5f24d89186b599f59ea2e7f1550
Diffstat (limited to 'lib/sqlalchemy/sql/visitors.py')
| -rw-r--r-- | lib/sqlalchemy/sql/visitors.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/visitors.py b/lib/sqlalchemy/sql/visitors.py index c06c95459..0a3cb8c1c 100644 --- a/lib/sqlalchemy/sql/visitors.py +++ b/lib/sqlalchemy/sql/visitors.py @@ -76,7 +76,8 @@ def _generate_dispatch(cls): """ if "__visit_name__" in cls.__dict__: visit_name = cls.__visit_name__ - if isinstance(visit_name, str): + + if isinstance(visit_name, util.compat.string_types): # There is an optimization opportunity here because the # the string name of the class's __visit_name__ is known at # this early stage (import time) so it can be pre-constructed. |
