summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorAdrian Tschira <nota@notafile.com>2018-04-07 00:37:36 +0200
committerAdrian Tschira <nota@notafile.com>2018-04-07 01:02:32 +0200
commite54c202b81707ef02b2e640489a69c2b266bebff (patch)
tree5418a0b3627ae1c880d19e58e839582b9c7a0331 /scripts
parentMerge pull request #3046 from matrix-org/dbkr/join_group (diff)
downloadsynapse-e54c202b81707ef02b2e640489a69c2b266bebff.tar.xz
Replace some type checks with six type checks
Signed-off-by: Adrian Tschira <nota@notafile.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/synapse_port_db4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/synapse_port_db b/scripts/synapse_port_db
index 7b23a44854..b9b828c154 100755
--- a/scripts/synapse_port_db
+++ b/scripts/synapse_port_db
@@ -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