mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #25239 - marmeladema:issue-23607/test-tidy-no-wpt, r=jdm
Make `mach test-tidy --no-wpt` compatible with Python3 Make `mach test-tidy --no-wpt` compatible with Python3 See also #23607 After this pull request, all python files (except WPT) will be checked for Python3 syntax compatibility. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
b3b72cb9e3
12 changed files with 118 additions and 107 deletions
|
@ -3943,8 +3943,8 @@ class CGMemberJITInfo(CGThing):
|
|||
depth=self.descriptor.interface.inheritanceDepth(),
|
||||
opType=opType,
|
||||
aliasSet=aliasSet,
|
||||
returnType=reduce(CGMemberJITInfo.getSingleReturnType, returnTypes,
|
||||
""),
|
||||
returnType=functools.reduce(CGMemberJITInfo.getSingleReturnType, returnTypes,
|
||||
""),
|
||||
isInfallible=toStringBool(infallible),
|
||||
isMovable=toStringBool(movable),
|
||||
# FIXME(nox): https://github.com/servo/servo/issues/10991
|
||||
|
@ -4131,8 +4131,8 @@ class CGMemberJITInfo(CGThing):
|
|||
if u.hasNullableType:
|
||||
# Might be null or not
|
||||
return "JSVAL_TYPE_UNKNOWN"
|
||||
return reduce(CGMemberJITInfo.getSingleReturnType,
|
||||
u.flatMemberTypes, "")
|
||||
return functools.reduce(CGMemberJITInfo.getSingleReturnType,
|
||||
u.flatMemberTypes, "")
|
||||
if t.isDictionary():
|
||||
return "JSVAL_TYPE_OBJECT"
|
||||
if t.isDate():
|
||||
|
@ -4202,8 +4202,8 @@ class CGMemberJITInfo(CGThing):
|
|||
if t.isUnion():
|
||||
u = t.unroll()
|
||||
type = "JSJitInfo::Null as i32" if u.hasNullableType else ""
|
||||
return reduce(CGMemberJITInfo.getSingleArgType,
|
||||
u.flatMemberTypes, type)
|
||||
return functools.reduce(CGMemberJITInfo.getSingleArgType,
|
||||
u.flatMemberTypes, type)
|
||||
if t.isDictionary():
|
||||
return "JSJitInfo_ArgType::Object as i32"
|
||||
if t.isDate():
|
||||
|
@ -5858,7 +5858,7 @@ class CGInterfaceTrait(CGThing):
|
|||
def contains_unsafe_arg(arguments):
|
||||
if not arguments or len(arguments) == 0:
|
||||
return False
|
||||
return reduce((lambda x, y: x or y[1] == '*mut JSContext'), arguments, False)
|
||||
return functools.reduce((lambda x, y: x or y[1] == '*mut JSContext'), arguments, False)
|
||||
|
||||
methods = []
|
||||
for name, arguments, rettype in members():
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue