mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-13 07:24:47 +00:00
Bug 1620744 - Convert gen_dll_blocklist_defs.py to py3; r=firefox-build-system-reviewers,rstewart
Differential Revision: https://phabricator.services.mozilla.com/D65852 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
dc0f12b8f8
commit
1874441242
@ -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'
|
||||
|
||||
|
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user