Skip to content

Commit

Permalink
Fix dict key sorting in Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ale-rt committed May 6, 2018
1 parent b33105d commit 1d3ee1e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Expand Up @@ -16,6 +16,9 @@ New features:

Bug fixes:

- Fix dict key sorting in Python 3
[ale-rt]

- Fix import from Globals that was removed in Zope4
[pbauer]

Expand Down
8 changes: 4 additions & 4 deletions Products/CMFFormController/FormAction.py
@@ -1,11 +1,13 @@
from .globalVars import ANY_CONTEXT, ANY_BUTTON
from .globalVars import ANY_BUTTON
from .globalVars import ANY_CONTEXT
from .Key import Key
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
from App.class_init import InitializeClass
from OFS.SimpleItem import SimpleItem
from Products.CMFCore.utils import getToolByName


_marker = []


Expand Down Expand Up @@ -187,9 +189,7 @@ def match(self, object_id, status, context_type, button):
def getFiltered(self, object_id=_marker, status=_marker, context_type=_marker,
button=_marker, action_type=_marker, action_arg=_marker):
filtered = []
keys = self.actions.keys()
keys.sort()
for key in keys:
for key in sorted(self.actions):
action = self.actions[key]
if object_id != _marker and not action.getObjectId() == object_id:
continue
Expand Down
8 changes: 4 additions & 4 deletions Products/CMFFormController/FormValidator.py
@@ -1,4 +1,5 @@
from .globalVars import ANY_CONTEXT, ANY_BUTTON
from .globalVars import ANY_BUTTON
from .globalVars import ANY_CONTEXT
from .Key import Key
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
Expand All @@ -8,6 +9,7 @@

import six


_marker = []


Expand Down Expand Up @@ -143,9 +145,7 @@ def match(self, object_id, context_type, button):
def getFiltered(self, object_id=_marker, context_type=_marker,
button=_marker, validators=_marker):
filtered = []
keys = self.validators.keys()
keys.sort()
for key in keys:
for key in sorted(self.validators):
validator = self.validators[key]
if object_id != _marker and not validator.getObjectId() == object_id:
continue
Expand Down

0 comments on commit 1d3ee1e

Please sign in to comment.