forked from mirrors/gecko-dev
		
	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
					
				
					 2 changed files with 6 additions and 13 deletions
				
			
		| 
						 | 
					@ -278,9 +278,7 @@ class BlocklistDescriptor(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Sort the list on entry name so that the blocklist code may use
 | 
					        # Sort the list on entry name so that the blocklist code may use
 | 
				
			||||||
        # binary search if it so chooses.
 | 
					        # binary search if it so chooses.
 | 
				
			||||||
        filtered_list.sort(key=lambda e: e.get_name())
 | 
					        return sorted(filtered_list, key=lambda e: e.get_name())
 | 
				
			||||||
 | 
					 | 
				
			||||||
        return filtered_list
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @staticmethod
 | 
					    @staticmethod
 | 
				
			||||||
    def get_fd(outspec_leaf_name):
 | 
					    def get_fd(outspec_leaf_name):
 | 
				
			||||||
| 
						 | 
					@ -371,11 +369,7 @@ GENERATED_BLOCKLIST_FILES = [
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PETimeStamp(object):
 | 
					class PETimeStamp(object):
 | 
				
			||||||
    def __init__(self, ts):
 | 
					    def __init__(self, ts):
 | 
				
			||||||
        # Since we can't specify the long literal suffix in python 3, we'll
 | 
					        max_timestamp = (2 ** 32) - 1
 | 
				
			||||||
        # 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)
 | 
					 | 
				
			||||||
        if ts < 0 or ts > max_timestamp:
 | 
					        if ts < 0 or ts > max_timestamp:
 | 
				
			||||||
            raise ValueError('Invalid timestamp value')
 | 
					            raise ValueError('Invalid timestamp value')
 | 
				
			||||||
        self._value = ts
 | 
					        self._value = ts
 | 
				
			||||||
| 
						 | 
					@ -413,7 +407,7 @@ class Version(object):
 | 
				
			||||||
            elif isinstance(args[0], PETimeStamp):
 | 
					            elif isinstance(args[0], PETimeStamp):
 | 
				
			||||||
                self._ver = args[0]
 | 
					                self._ver = args[0]
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                self._ver = long(args[0])
 | 
					                self._ver = int(args[0])
 | 
				
			||||||
        elif len(args) == 4:
 | 
					        elif len(args) == 4:
 | 
				
			||||||
            self.validate_iterable(args)
 | 
					            self.validate_iterable(args)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -433,14 +427,14 @@ class Version(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def build_long(self, args):
 | 
					    def build_long(self, args):
 | 
				
			||||||
        self.validate_iterable(args)
 | 
					        self.validate_iterable(args)
 | 
				
			||||||
        return (long(args[0]) << 48) | (long(args[1]) << 32) | \
 | 
					        return (int(args[0]) << 48) | (int(args[1]) << 32) | \
 | 
				
			||||||
            (long(args[2]) << 16) | long(args[3])
 | 
					            (int(args[2]) << 16) | int(args[3])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def is_timestamp(self):
 | 
					    def is_timestamp(self):
 | 
				
			||||||
        return isinstance(self._ver, PETimeStamp)
 | 
					        return isinstance(self._ver, PETimeStamp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        if isinstance(self._ver, long):
 | 
					        if isinstance(self._ver, int):
 | 
				
			||||||
            if self._ver == Version.ALL_VERSIONS:
 | 
					            if self._ver == Version.ALL_VERSIONS:
 | 
				
			||||||
                return 'DllBlockInfo::ALL_VERSIONS'
 | 
					                return 'DllBlockInfo::ALL_VERSIONS'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -53,7 +53,6 @@ GENERATED_FILES += [
 | 
				
			||||||
blocklist_defs = GENERATED_FILES[blocklist_files]
 | 
					blocklist_defs = GENERATED_FILES[blocklist_files]
 | 
				
			||||||
blocklist_defs.script = 'gen_dll_blocklist_defs.py:gen_blocklists'
 | 
					blocklist_defs.script = 'gen_dll_blocklist_defs.py:gen_blocklists'
 | 
				
			||||||
blocklist_defs.inputs = ['WindowsDllBlocklistDefs.in']
 | 
					blocklist_defs.inputs = ['WindowsDllBlocklistDefs.in']
 | 
				
			||||||
blocklist_defs.py2 = True
 | 
					 | 
				
			||||||
EXPORTS.mozilla += ['!' + hdr for hdr in blocklist_files]
 | 
					EXPORTS.mozilla += ['!' + hdr for hdr in blocklist_files]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FINAL_LIBRARY = 'mozglue'
 | 
					FINAL_LIBRARY = 'mozglue'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue