diff options
author | Federico Caselli <cfederico87@gmail.com> | 2021-11-21 21:17:27 +0100 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-11-24 22:51:27 -0500 |
commit | 31acba8ff7c123a20ae308b7f4ab6df3df264b48 (patch) | |
tree | a4c39a2123e1b95edf17995ba85bb69ee619f6e4 /lib/sqlalchemy/dialects/mysql/enumerated.py | |
parent | d3a4e96196cd47858de072ae589c6554088edc24 (diff) | |
download | sqlalchemy-31acba8ff7c123a20ae308b7f4ab6df3df264b48.tar.gz |
Clean up most py3k compat
Change-Id: I8172fdcc3103ff92aa049827728484c8779af6b7
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/enumerated.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/enumerated.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/enumerated.py b/lib/sqlalchemy/dialects/mysql/enumerated.py index 9f9a838c5..b84608f58 100644 --- a/lib/sqlalchemy/dialects/mysql/enumerated.py +++ b/lib/sqlalchemy/dialects/mysql/enumerated.py @@ -201,7 +201,7 @@ class SET(_StringType): super_convert = super(SET, self).result_processor(dialect, coltype) def process(value): - if isinstance(value, util.string_types): + if isinstance(value, str): # MySQLdb returns a string, let's parse if super_convert: value = super_convert(value) @@ -222,7 +222,7 @@ class SET(_StringType): def process(value): if value is None: return None - elif isinstance(value, util.int_types + util.string_types): + elif isinstance(value, (int, str)): if super_convert: return super_convert(value) else: @@ -237,9 +237,7 @@ class SET(_StringType): def process(value): # accept strings and int (actually bitflag) values directly - if value is not None and not isinstance( - value, util.int_types + util.string_types - ): + if value is not None and not isinstance(value, (int, str)): value = ",".join(value) if super_convert: |