diff --git a/cssselect2/__init__.py b/cssselect2/__init__.py index 923b9c5..28baced 100644 --- a/cssselect2/__init__.py +++ b/cssselect2/__init__.py @@ -6,8 +6,6 @@ """ -import operator - from webencodings import ascii_lower # Classes are imported here to expose them at the top level of the module @@ -109,7 +107,7 @@ def match(self, element): self.add_relevant_selectors( element, self.other_selectors, relevant_selectors) - relevant_selectors.sort(key=SORT_KEY) + relevant_selectors.sort() return relevant_selectors @staticmethod @@ -118,6 +116,3 @@ def add_relevant_selectors(element, selectors, relevant_selectors): if test(element): relevant_selectors.append( (specificity, order, pseudo, payload)) - - -SORT_KEY = operator.itemgetter(0, 1)