Commit 01db44c6 authored by Ryan Herbert's avatar Ryan Herbert Committed by Mikaël Salson

vidjilparser.py python3-compatible type check

parent 1c2b42a8
#!/usr/bin/python #!/usr/bin/python
import ijson import ijson
from six import string_types
class VidjilWriter(object): class VidjilWriter(object):
...@@ -49,7 +50,7 @@ class VidjilWriter(object): ...@@ -49,7 +50,7 @@ class VidjilWriter(object):
value = str(value).lower() value = str(value).lower()
mstr = '{}' mstr = '{}'
padding = '' padding = ''
if type(value) in [str, unicode] : if isinstance(value, string_types) :
value = value.replace("\n", "\\n") value = value.replace("\n", "\\n")
value = value.replace("\r", "\\r") value = value.replace("\r", "\\r")
if previous not in ['', 'map_key', 'start_map', 'start_array'] and event not in ['end_map', 'end_array']: if previous not in ['', 'map_key', 'start_map', 'start_array'] and event not in ['end_map', 'end_array']:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment