Import ABC from collections.abc (#983)

Use compatibility layer for Python 2 support
This commit is contained in:
Karthikeyan Singaravelan 2020-07-16 19:32:51 +05:30 committed by GitHub
parent 058cb87d2a
commit 165ba412e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View file

@ -1,7 +1,6 @@
from meshroom.common import BaseObject, Property, Variant, VariantList
from meshroom.core import pyCompatibility
from enum import Enum # available by default in python3. For python2: "pip install enum34"
import collections
import math
import os
import psutil
@ -230,7 +229,7 @@ class ChoiceParam(Param):
if self.exclusive:
return self.conformValue(value)
if not isinstance(value, collections.Iterable):
if not isinstance(value, pyCompatibility.Iterable):
raise ValueError('Non exclusive ChoiceParam value should be iterable (param:{}, value:{}, type:{})'.format(self.name, value, type(value)))
return [self.conformValue(v) for v in value]