mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Simple Python 3 compatibility changes
Summary: Changes that move towards python 3 compatibility that are easy to review without much thought Test Plan: The tests Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2873
This commit is contained in:
@@ -2,6 +2,8 @@ import json
|
||||
import types
|
||||
from collections import namedtuple
|
||||
|
||||
import six
|
||||
|
||||
import depend
|
||||
import objtypes
|
||||
import usertypes
|
||||
@@ -302,7 +304,7 @@ class ChoiceListColumn(BaseColumn):
|
||||
def set(self, row_id, value):
|
||||
# When a JSON string is loaded, set it to a tuple parsed from it. When a list is loaded,
|
||||
# convert to a tuple to keep values immutable.
|
||||
if isinstance(value, basestring) and value.startswith('['):
|
||||
if isinstance(value, six.string_types) and value.startswith(u'['):
|
||||
try:
|
||||
value = tuple(json.loads(value))
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user