diff -Nrup a/build/check.py b/build/check.py --- a/build/check.py 2017-09-22 14:14:23.000000000 +0200 +++ b/build/check.py 2019-09-26 05:07:45.860454310 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python3 # # check.py : Run all the test cases. # @@ -10,9 +10,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -52,16 +52,16 @@ if __name__ == '__main__': # Find test responses and run them one by one for case in glob.glob(testdir + "/testcases/*.response"): - print "== Testing %s ==" % (case) + print("== Testing %s ==" % (case)) try: subprocess.check_call([SERF_RESPONSE_EXE, case]) except subprocess.CalledProcessError, x: - print "ERROR: test failed in '%s', exit code=%d" % (x.cmd, x.returncode) + print("ERROR: test failed in '%s', exit code=%d" % (x.cmd, x.returncode)) sys.exit(1) - print "== Running the unit tests ==" + print("== Running the unit tests ==") try: subprocess.check_call(TEST_ALL_EXE) except subprocess.CalledProcessError, x: - print "ERROR: test(s) failed in '%s', exit code=%d" % (x.cmd, x.returncode) + print("ERROR: test(s) failed in '%s', exit code=%d" % (x.cmd, x.returncode)) sys.exit(1) diff -Nrup a/SConstruct b/SConstruct --- a/SConstruct 2017-09-22 14:14:23.000000000 +0200 +++ b/SConstruct 2019-09-26 05:06:32.230764081 +0200 @@ -20,6 +20,8 @@ # ==================================================================== # +from __future__ import print_function + import sys import os import re @@ -182,7 +184,7 @@ env.Append(BUILDERS = { match = re.search('SERF_MAJOR_VERSION ([0-9]+).*' 'SERF_MINOR_VERSION ([0-9]+).*' 'SERF_PATCH_VERSION ([0-9]+)', - env.File('serf.h').get_contents(), + env.File('serf.h').get_contents().decode('utf-8'), re.DOTALL) MAJOR, MINOR, PATCH = [int(x) for x in match.groups()] env.Append(MAJOR=str(MAJOR)) @@ -199,7 +201,7 @@ CALLOUT_OKAY = not (env.GetOption('clean unknown = opts.UnknownVariables() if unknown: - print 'Warning: Used unknown variables:', ', '.join(unknown.keys()) + print('Warning: Used unknown variables:', ', '.join(unknown.keys())) apr = str(env['APR']) apu = str(env['APU']) @@ -480,7 +482,7 @@ if brotli and CALLOUT_OKAY: conf.CheckFunc('BrotliDecoderTakeOutput'): env.Append(CPPDEFINES=['SERF_HAVE_BROTLI']) else: - print "Cannot find Brotli library >= 1.0.0 in '%s'." % env.get('BROTLI') + print("Cannot find Brotli library >= 1.0.0 in '%s'." % env.get('BROTLI')) Exit(1) env = conf.Finish()