Fix print() and xrange() for Python 3 (#5590)

This commit is contained in:
cclauss
2018-03-14 09:37:29 -07:00
committed by ohemorange
parent 9ea14d2e2b
commit e405aaa4c1
5 changed files with 6 additions and 2 deletions
@@ -10,6 +10,8 @@ import sys
import OpenSSL import OpenSSL
from six.moves import xrange # pylint: disable=import-error,redefined-builtin
from acme import challenges from acme import challenges
from acme import crypto_util from acme import crypto_util
from acme import messages from acme import messages
@@ -5,6 +5,7 @@ import requests
import zope.interface import zope.interface
import six import six
from six.moves import xrange # pylint: disable=import-error,redefined-builtin
from acme import crypto_util from acme import crypto_util
from acme import errors as acme_errors from acme import errors as acme_errors
@@ -8,7 +8,7 @@ from certbot_nginx import nginxparser
def roundtrip(stuff): def roundtrip(stuff):
success = True success = True
for t in stuff: for t in stuff:
print t print(t)
if not os.path.isfile(t): if not os.path.isfile(t):
continue continue
with open(t, "r") as f: with open(t, "r") as f:
@@ -18,6 +18,7 @@ from threading import Thread
from unittest import TestCase from unittest import TestCase
from pytest import mark from pytest import mark
from six.moves import xrange # pylint: disable=redefined-builtin
@mark.skip @mark.skip
+1 -1
View File
@@ -14,7 +14,7 @@ def serve_forever(port=0):
""" """
server = HTTPServer(('', port), SimpleHTTPRequestHandler) server = HTTPServer(('', port), SimpleHTTPRequestHandler)
print 'Serving HTTP on {0} port {1} ...'.format(*server.server_address) print('Serving HTTP on {0} port {1} ...'.format(*server.server_address))
sys.stdout.flush() sys.stdout.flush()
server.serve_forever() server.serve_forever()