diff --git a/mozglue/dllservices/gen_dll_blocklist_defs.py b/mozglue/dllservices/gen_dll_blocklist_defs.py index d55de948ad5f..ecda2baa13df 100644 --- a/mozglue/dllservices/gen_dll_blocklist_defs.py +++ b/mozglue/dllservices/gen_dll_blocklist_defs.py @@ -278,9 +278,7 @@ class BlocklistDescriptor(object): # Sort the list on entry name so that the blocklist code may use # binary search if it so chooses. - filtered_list.sort(key=lambda e: e.get_name()) - - return filtered_list + return sorted(filtered_list, key=lambda e: e.get_name()) @staticmethod def get_fd(outspec_leaf_name): @@ -371,11 +369,7 @@ GENERATED_BLOCKLIST_FILES = [ class PETimeStamp(object): def __init__(self, ts): - # Since we can't specify the long literal suffix in python 3, we'll - # compute max_timestamp this way to ensure that it is defined as a - # long in python 2 - max_timestamp = (long(2) ** 32) - 1 - assert isinstance(max_timestamp, long) + max_timestamp = (2 ** 32) - 1 if ts < 0 or ts > max_timestamp: raise ValueError('Invalid timestamp value') self._value = ts @@ -413,7 +407,7 @@ class Version(object): elif isinstance(args[0], PETimeStamp): self._ver = args[0] else: - self._ver = long(args[0]) + self._ver = int(args[0]) elif len(args) == 4: self.validate_iterable(args) @@ -433,14 +427,14 @@ class Version(object): def build_long(self, args): self.validate_iterable(args) - return (long(args[0]) << 48) | (long(args[1]) << 32) | \ - (long(args[2]) << 16) | long(args[3]) + return (int(args[0]) << 48) | (int(args[1]) << 32) | \ + (int(args[2]) << 16) | int(args[3]) def is_timestamp(self): return isinstance(self._ver, PETimeStamp) def __str__(self): - if isinstance(self._ver, long): + if isinstance(self._ver, int): if self._ver == Version.ALL_VERSIONS: return 'DllBlockInfo::ALL_VERSIONS' diff --git a/mozglue/dllservices/moz.build b/mozglue/dllservices/moz.build index 3cafc915e361..ba73d8c7ef1c 100644 --- a/mozglue/dllservices/moz.build +++ b/mozglue/dllservices/moz.build @@ -53,7 +53,6 @@ GENERATED_FILES += [ blocklist_defs = GENERATED_FILES[blocklist_files] blocklist_defs.script = 'gen_dll_blocklist_defs.py:gen_blocklists' blocklist_defs.inputs = ['WindowsDllBlocklistDefs.in'] -blocklist_defs.py2 = True EXPORTS.mozilla += ['!' + hdr for hdr in blocklist_files] FINAL_LIBRARY = 'mozglue'