Bug 1474739 - Part 3: Linting fixes on a CLOSED TREE, a=bustage
authorNika Layzell <nika@thelayzells.com>
Wed, 01 Aug 2018 18:23:15 -0400
changeset 825653 62a0e59c7e1a23a0774c4cca4ea2cd98c0838ff0
parent 825652 da7308cd7b0f1f50bde54e908ef86e2fdba2b792
child 825654 8b21457cfcd87dfa47ece25f87af1433d254275e
push id118150
push usermaglione.k@gmail.com
push dateThu, 02 Aug 2018 04:47:08 +0000
reviewersbustage
bugs1474739
milestone63.0a1
Bug 1474739 - Part 3: Linting fixes on a CLOSED TREE, a=bustage
xpcom/ds/tools/perfecthash.py
xpcom/idl-parser/xpidl/jsonxpt.py
xpcom/reflect/xptinfo/xptcodegen.py
--- a/xpcom/ds/tools/perfecthash.py
+++ b/xpcom/ds/tools/perfecthash.py
@@ -37,17 +37,17 @@ class PerfectHash(object):
     # 32-bit FNV offset basis and prime value.
     FNV_OFFSET_BASIS = 0x811C9DC5
     FNV_PRIME = 16777619
     U32_MAX = 0xffffffff
 
     # Bucket of entries which map into a given intermediate index.
     Bucket = namedtuple('Bucket', 'index entries')
 
-    def __init__(self, entries, size, validate=True, key=lambda (k, _): k):
+    def __init__(self, entries, size, validate=True, key=lambda e: e[0]):
         """Create a new PerfectHash
 
         @param entries  set of entries to generate a PHF for
         @param size     size of the PHF intermediate table
         @param validate test the generated hash function after generation
         @param key      function to get 'memoryview'-compatible key for an
                         entry. defaults to extracting the first element of an
                         entry 2-tuple.
--- a/xpcom/idl-parser/xpidl/jsonxpt.py
+++ b/xpcom/idl-parser/xpidl/jsonxpt.py
@@ -231,18 +231,20 @@ def build_interface(iface):
 # functions, but are exported so that if we need to do something more
 # complex in them in the future we can.
 
 def build_typelib(idl):
     """Given a parsed IDL file, generate and return the typelib"""
     return [build_interface(p) for p in idl.productions
             if p.kind == 'interface' and p.attributes.scriptable]
 
+
 def link(typelibs):
     """Link a list of typelibs together into a single typelib"""
     linked = list(itertools.chain.from_iterable(typelibs))
     assert len(set(iface['name'] for iface in linked)) == len(linked), \
         "Multiple typelibs containing the same interface were linked together"
     return linked
 
+
 def write(typelib, fd):
     """Write typelib into fd"""
     json.dump(typelib, fd, indent=2)
--- a/xpcom/reflect/xptinfo/xptcodegen.py
+++ b/xpcom/reflect/xptinfo/xptcodegen.py
@@ -200,17 +200,16 @@ def link_to_cpp(interfaces, fd):
     # class due to how this file's code evolved.
     includes = set()
     types = []
     type_cache = {}
     params = []
     param_cache = {}
     methods = []
     consts = []
-    prophooks = []
     domobjects = []
     domobject_cache = {}
     strings = OrderedDict()
 
     def lower_uuid(uuid):
         return ("{0x%s, 0x%s, 0x%s, {0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s}}" %
                 split_iid(uuid))