2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

python: Fix print function compatibility.

The print statement from Python 2 is a function in Python 3.  Enable
print function support for Python 2 and convert print statements to
function calls.

Enable the H233 flake8 warning.  If the hacking plugin is installed,
this will generate warnings for print statement usage not compatible
with Python 3.

  H233 Python 3.x incompatible use of print operator

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Russell Bryant
2015-12-14 10:21:53 -05:00
parent f3068bff92
commit 8ea171aba0
9 changed files with 74 additions and 57 deletions

View File

@@ -16,6 +16,8 @@
rpcserver is an XML RPC server that allows RPC client to initiate tests
"""
from __future__ import print_function
import exceptions
import sys
import xmlrpclib
@@ -357,7 +359,7 @@ def start_rpc_server(port):
rpc_server = TestArena()
reactor.listenTCP(port, server.Site(rpc_server))
try:
print "Starting RPC server\n"
print("Starting RPC server\n")
sys.stdout.flush()
# If this server was started from ovs-test client then we must flush
# STDOUT so that client would know that server is ready to accept