Commit ee7084c9 authored by Jérome Perrin's avatar Jérome Perrin

fix SyntaxWarning

parent 50952888
...@@ -111,7 +111,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin): ...@@ -111,7 +111,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
| morphology/2 | (colour/blue, colour/red, size/Man, size/Woman, morphology/2) | morphology/2 | (colour/blue, colour/red, size/Man, size/Woman, morphology/2)
""" """
result = [] result = []
if base_category_list is (): if base_category_list == ():
base_category_list = self.getVariationBaseCategoryList( base_category_list = self.getVariationBaseCategoryList(
omit_individual_variation=omit_individual_variation) omit_individual_variation=omit_individual_variation)
elif isinstance(base_category_list, str): elif isinstance(base_category_list, str):
...@@ -127,7 +127,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin): ...@@ -127,7 +127,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
if not omit_individual_variation: if not omit_individual_variation:
for variation in individual_variation_list: for variation in individual_variation_list:
for base_category in variation.getVariationBaseCategoryList(): for base_category in variation.getVariationBaseCategoryList():
if base_category_list is ()\ if base_category_list == ()\
or base_category in base_category_list: or base_category in base_category_list:
other_base_category_set.discard(base_category) other_base_category_set.discard(base_category)
# XXX now, call Renderer a lot of time. # XXX now, call Renderer a lot of time.
...@@ -196,7 +196,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin): ...@@ -196,7 +196,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
for base_category in variation.getVariationBaseCategoryList(): for base_category in variation.getVariationBaseCategoryList():
# backwards compatbility: if individual_bc_list is empty, allow # backwards compatbility: if individual_bc_list is empty, allow
# all individual variation base categories. # all individual variation base categories.
if (base_category_list is () if (base_category_list == ()
or base_category in base_category_list)\ or base_category in base_category_list)\
and (not len(individual_bc_list) and (not len(individual_bc_list)
or base_category in individual_bc_list): or base_category in individual_bc_list):
......
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