Fix python 2.7 support

This commit is contained in:
allegroai
2022-09-18 14:18:40 +03:00
parent 0c5d12b830
commit 59932e4f4c
4 changed files with 8 additions and 4 deletions

View File

@@ -2206,7 +2206,8 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
# make sure we have str as values:
for key in requirements.keys():
if requirements[key] and not isinstance(requirements[key], str):
# fix python2 support (str/unicode)
if requirements[key] and not isinstance(requirements[key], six.string_types):
requirements[key] = '\n'.join(requirements[key])
# protection, Old API might not support it