Commit 6705411b authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Arnaud Fontaine

py2/py3: use six.get_unbound_function.

parent 33c22ba6
...@@ -35,8 +35,9 @@ from Products.ERP5Type.patches.WorkflowTool import \ ...@@ -35,8 +35,9 @@ from Products.ERP5Type.patches.WorkflowTool import \
WorkflowHistoryList as LegacyWorkflowHistoryList WorkflowHistoryList as LegacyWorkflowHistoryList
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from six.moves import range from six.moves import range
from six import get_unbound_function
orig_maybe_rotate = DoublyLinkList._maybe_rotate.__func__ orig_maybe_rotate = get_unbound_function(DoublyLinkList._maybe_rotate)
def _maybe_rotate(self): def _maybe_rotate(self):
if len(self._log) < 16: if len(self._log) < 16:
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type import Permissions, PropertySheet, interfaces
from erp5.component.document.Movement import Movement from erp5.component.document.Movement import Movement
from six import get_unbound_function
class DummyMovement(Movement): class DummyMovement(Movement):
"""Dummy Movement for testing purposes.""" """Dummy Movement for testing purposes."""
...@@ -72,7 +72,7 @@ class DummyMovement(Movement): ...@@ -72,7 +72,7 @@ class DummyMovement(Movement):
parent = self.getParentValue() parent = self.getParentValue()
if isinstance(parent, DummyDelivery): if isinstance(parent, DummyDelivery):
self = parent self = parent
return DummyDelivery.getSimulationState(self) return get_unbound_function(DummyDelivery.getSimulationState)(self)
def getDeliveryValue(self): def getDeliveryValue(self):
""" """
......
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