From 1c082016a8569592284e6c2e450509fb8bfb1450 Mon Sep 17 00:00:00 2001 From: Ryan Herbert Date: Thu, 7 Jun 2018 15:20:10 +0100 Subject: [PATCH] vidjilparser.py python3-compatible type check --- tools/vidjilparser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/vidjilparser.py b/tools/vidjilparser.py index 0f0f468b5..7c3776e12 100644 --- a/tools/vidjilparser.py +++ b/tools/vidjilparser.py @@ -1,5 +1,6 @@ #!/usr/bin/python import ijson +from six import string_types class VidjilWriter(object): @@ -49,7 +50,7 @@ class VidjilWriter(object): value = str(value).lower() mstr = '{}' padding = '' - if type(value) in [str, unicode] : + if isinstance(value, string_types) : value = value.replace("\n", "\\n") value = value.replace("\r", "\\r") if previous not in ['', 'map_key', 'start_map', 'start_array'] and event not in ['end_map', 'end_array']: -- GitLab