diff --git a/contrib/apple-sdk-tools/extract_xcode.py b/contrib/apple-sdk-tools/extract_xcode.py --- a/contrib/apple-sdk-tools/extract_xcode.py +++ b/contrib/apple-sdk-tools/extract_xcode.py @@ -34,10 +34,10 @@ def __exit__(self, exc_type, exc_val, exc_tb): if self.filename != '-': self.fh.close() - def write(self, bytes): + def write(self, b): if self.filename != '-': - return self.fh.write(bytes) - return self.fh.buffer.write(bytes) + return self.fh.write(b) + return self.fh.buffer.write(b) def read(self, size): if self.filename != '-': return self.fh.read(size) @@ -62,13 +62,13 @@ print("bad xar magic", file=sys.stderr) sys.exit(1) - bytes = infile.read(24) - header_size, xar_version, toc_compressed, toc_uncompressed, checksum_type = struct.unpack('>HHQQI', bytes) + in_bytes = infile.read(24) + header_size, xar_version, toc_compressed, toc_uncompressed, checksum_type = struct.unpack('>HHQQI', in_bytes) start_offset += header_size start_offset += toc_compressed - bytes = infile.read(toc_compressed) + in_bytes = infile.read(toc_compressed) - xml_toc = zlib.decompress(bytes).decode("utf-8") + xml_toc = zlib.decompress(in_bytes).decode("utf-8") root = ET.fromstring(xml_toc) @@ -102,28 +102,28 @@ print("bad pbzx magic", file=sys.stderr) sys.exit(2) - bytes = infile.read(8) + in_bytes = infile.read(8) content_read_size += 8 - flags, = struct.unpack('>Q', bytes) - bytes = infile.read(16) + flags, = struct.unpack('>Q', in_bytes) + in_bytes = infile.read(16) content_read_size += 16 while (flags & 1 << 24): - flags, size = struct.unpack('>QQ', bytes) - bytes = infile.read(size) + flags, size = struct.unpack('>QQ', in_bytes) + in_bytes = infile.read(size) content_read_size += size compressed = size != 1 << 24 if compressed: - if bytes[0:6] != LZMA_MAGIC: + if in_bytes[0:6] != LZMA_MAGIC: print("bad lzma magic: ", file=sys.stderr) sys.exit(3) - outfile.write(lzma.decompress(bytes)) + outfile.write(lzma.decompress(in_bytes)) else: - outfile.write(bytes) + outfile.write(in_bytes) if content_read_size == content_length: break - - bytes = infile.read(16) + + in_bytes = infile.read(16) content_read_size += 16 if __name__ == '__main__': diff --git a/contrib/macdeploy/macdeployqtplus.py b/contrib/macdeploy/macdeployqtplus.py --- a/contrib/macdeploy/macdeployqtplus.py +++ b/contrib/macdeploy/macdeployqtplus.py @@ -262,12 +262,12 @@ runInstallNameTool("change", oldName, newName, binaryPath) -def changeIdentification(id: str, binaryPath: str, verbose: int): +def changeIdentification(id_name: str, binaryPath: str, verbose: int): if verbose >= 3: print("Using install_name_tool:") print(" change identification in", binaryPath) - print(" to", id) - runInstallNameTool("id", id, binaryPath) + print(" to", id_name) + runInstallNameTool("id", id_name, binaryPath) def runStrip(binaryPath: str, verbose: int): diff --git a/contrib/tracing/p2p_monitor.py b/contrib/tracing/p2p_monitor.py --- a/contrib/tracing/p2p_monitor.py +++ b/contrib/tracing/p2p_monitor.py @@ -96,8 +96,8 @@ total_outbound_msgs = 0 total_outbound_bytes = 0 - def __init__(self, id, address, connection_type): - self.id = id + def __init__(self, peer_id, address, connection_type): + self.id = peer_id self.address = address self.connection_type = connection_type self.last_messages = []