diff options
author | marmeladema <xademax@gmail.com> | 2019-12-10 23:56:12 +0000 |
---|---|---|
committer | marmeladema <xademax@gmail.com> | 2019-12-11 16:03:20 +0000 |
commit | 7b5fabe8552b9245a70961db9ec592a55102bb0e (patch) | |
tree | b31bc428ddabb8dfeaabafaff504f4db7e937401 /components/script/dom/bindings/codegen/Configuration.py | |
parent | 9d04f231f4a32050d78221d4e13d4951df649269 (diff) | |
download | servo-7b5fabe8552b9245a70961db9ec592a55102bb0e.tar.gz servo-7b5fabe8552b9245a70961db9ec592a55102bb0e.zip |
Fix tidiness errors for Python3 compatibility across whole repo
Diffstat (limited to 'components/script/dom/bindings/codegen/Configuration.py')
-rw-r--r-- | components/script/dom/bindings/codegen/Configuration.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/bindings/codegen/Configuration.py b/components/script/dom/bindings/codegen/Configuration.py index 71c988e5378..84d8bd974aa 100644 --- a/components/script/dom/bindings/codegen/Configuration.py +++ b/components/script/dom/bindings/codegen/Configuration.py @@ -2,6 +2,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. +import functools import os from WebIDL import IDLExternalInterface, IDLSequenceType, IDLWrapperType, WebIDLError @@ -15,7 +16,7 @@ class Configuration: def __init__(self, filename, parseData): # Read the configuration file. glbl = {} - execfile(filename, glbl) + exec(compile(open(filename).read(), filename, 'exec'), glbl) config = glbl['DOMInterfaces'] # Build descriptors for all the interfaces we have in the parse data. @@ -62,7 +63,8 @@ class Configuration: c.isCallback() and not c.isInterface()] # Keep the descriptor list sorted for determinism. - self.descriptors.sort(lambda x, y: cmp(x.name, y.name)) + cmp = lambda x, y: (x > y) - (x < y) + self.descriptors.sort(key=functools.cmp_to_key(lambda x, y: cmp(x.name, y.name))) def getInterface(self, ifname): return self.interfaces[ifname] |