Commit e18d9c2a authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Jérome Perrin

py2/py3: cast dict.keys() to list.

parent 93fe2adb
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
# #
############################################################################## ##############################################################################
from Products.ERP5Type.Utils import ensure_list
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
...@@ -240,7 +241,7 @@ class TestOrderBuilderMixin(TestOrderMixin, InventoryAPITestCase): ...@@ -240,7 +241,7 @@ class TestOrderBuilderMixin(TestOrderMixin, InventoryAPITestCase):
self.wanted_quantity_matrix = self.decrease_quantity_matrix.copy() self.wanted_quantity_matrix = self.decrease_quantity_matrix.copy()
packing_list_line.setVariationCategoryList( packing_list_line.setVariationCategoryList(
self.decrease_quantity_matrix.keys(), ensure_list(self.decrease_quantity_matrix.keys()),
) )
self.tic() self.tic()
......
...@@ -32,6 +32,7 @@ from AccessControl import ClassSecurityInfo ...@@ -32,6 +32,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Globals import InitializeClass from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
from Products.ERP5Type.Tool.BaseTool import BaseTool from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type.Utils import ensure_list
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery
import six import six
...@@ -337,7 +338,7 @@ class DomainTool(BaseTool): ...@@ -337,7 +338,7 @@ class DomainTool(BaseTool):
mapped_value = self.getPortalObject().newContent(temp_object=True, mapped_value = self.getPortalObject().newContent(temp_object=True,
portal_type='Supply Cell', id='multivalued_mapped_value') portal_type='Supply Cell', id='multivalued_mapped_value')
mapped_value._setMappedValuePropertyList( mapped_value._setMappedValuePropertyList(
mapped_value_property_dict.keys()) ensure_list(mapped_value_property_dict.keys()))
mapped_value.__dict__.update(mapped_value_property_dict) mapped_value.__dict__.update(mapped_value_property_dict)
return mapped_value return mapped_value
......
...@@ -30,7 +30,7 @@ from Products.ERP5Type.Globals import InitializeClass, PersistentMapping ...@@ -30,7 +30,7 @@ from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from Acquisition import aq_base from Acquisition import aq_base
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
from Products.ERP5Type.Utils import cartesianProduct, INFINITE_SET from Products.ERP5Type.Utils import cartesianProduct, ensure_list, INFINITE_SET
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from zLOG import LOG from zLOG import LOG
...@@ -163,7 +163,7 @@ class Matrix(object): ...@@ -163,7 +163,7 @@ class Matrix(object):
else: else:
delete = set() delete = set()
to_delete.append(delete) to_delete.append(delete)
for k, v in id_dict.items(): for k, v in ensure_list(id_dict.items()):
try: try:
axis.remove(k) axis.remove(k)
if last_id < v: if last_id < v:
......
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