mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 08:56:04 -04:00
Replace some type checks with six type checks
Signed-off-by: Adrian Tschira <nota@notafile.com>
This commit is contained in:
parent
135fc5b9cd
commit
e54c202b81
5 changed files with 18 additions and 8 deletions
|
@ -30,6 +30,8 @@ import time
|
|||
import traceback
|
||||
import yaml
|
||||
|
||||
from six import string_types
|
||||
|
||||
|
||||
logger = logging.getLogger("synapse_port_db")
|
||||
|
||||
|
@ -574,7 +576,7 @@ class Porter(object):
|
|||
def conv(j, col):
|
||||
if j in bool_cols:
|
||||
return bool(col)
|
||||
elif isinstance(col, basestring) and "\0" in col:
|
||||
elif isinstance(col, string_types) and "\0" in col:
|
||||
logger.warn("DROPPING ROW: NUL value in table %s col %s: %r", table, headers[j], col)
|
||||
raise BadValueException();
|
||||
return col
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue