diff --git a/tools/capture2pcap.py b/tools/capture2pcap.py index 49f20086..fff1c725 100644 --- a/tools/capture2pcap.py +++ b/tools/capture2pcap.py @@ -17,6 +17,7 @@ issue. TODO(htuch): - Figure out IPv6 PCAP issue above, or file a bug once the root cause is clear. """ +from __future__ import print_function import datetime import socket @@ -81,6 +82,6 @@ def Capture2Pcap(capture_path, pcap_path): if __name__ == '__main__': if len(sys.argv) != 3: - print 'Usage: %s ' % sys.argv[0] + print('Usage: %s ' % sys.argv[0]) sys.exit(1) Capture2Pcap(sys.argv[1], sys.argv[2]) diff --git a/tools/capture2pcap_test.py b/tools/capture2pcap_test.py index bcbd04b6..055e0e6e 100644 --- a/tools/capture2pcap_test.py +++ b/tools/capture2pcap_test.py @@ -1,4 +1,5 @@ """Tests for capture2pcap.""" +from __future__ import print_function import os import subprocess as sp @@ -20,7 +21,7 @@ if __name__ == '__main__': with open(expected_path, 'r') as f: expected_output = f.read() if actual_output != expected_output: - print 'Mismatch' - print 'Expected: %s' % expected_output - print 'Actual: %s' % actual_output + print('Mismatch') + print('Expected: %s' % expected_output) + print('Actual: %s' % actual_output) sys.exit(1) diff --git a/tools/generate_listeners.py b/tools/generate_listeners.py index 7a3f8c28..9d073ccc 100644 --- a/tools/generate_listeners.py +++ b/tools/generate_listeners.py @@ -47,7 +47,7 @@ def GenerateListeners(listeners_pb_path, output_pb_path, output_json_path, fragm for filter_chain in listener.filter_chains: for f in filter_chain.filters: - f.config.CopyFrom(ProtoToStruct(ParseProto(fragments.next(), f.name))) + f.config.CopyFrom(ProtoToStruct(ParseProto(next(fragments), f.name))) with open(output_pb_path, 'w') as f: f.write(str(listener))