diff --git a/build_scripts/build_osd.py b/build_scripts/build_osd.py
index e8ebef88..4b2b6fb9 100644
--- a/build_scripts/build_osd.py
+++ b/build_scripts/build_osd.py
@@ -38,7 +38,7 @@ import shutil
import subprocess
import sys
import tarfile
-import urllib2
+import urllib.request, urllib.error, urllib.parse
import zipfile
# Helpers for printing output
@@ -46,26 +46,26 @@ verbosity = 1
def Print(msg):
if verbosity > 0:
- print msg
+ print(msg)
def PrintWarning(warning):
if verbosity > 0:
- print "WARNING:", warning
+ print("WARNING:", warning)
def PrintStatus(status):
if verbosity >= 1:
- print "STATUS:", status
+ print("STATUS:", status)
def PrintInfo(info):
if verbosity >= 2:
- print "INFO:", info
+ print("INFO:", info)
def PrintCommandOutput(output):
if verbosity >= 3:
sys.stdout.write(output)
def PrintError(error):
- print "ERROR:", error
+ print("ERROR:", error)
# Helpers for determining platform
def Windows():
@@ -290,7 +290,7 @@ def DownloadFileWithPowershell(url, outputFilename):
Run(cmd,logCommandOutput=False)
def DownloadFileWithUrllib(url, outputFilename):
- r = urllib2.urlopen(url)
+ r = urllib.request.urlopen(url)
with open(outputFilename, "wb") as outfile:
outfile.write(r.read())
@@ -329,7 +329,7 @@ def DownloadURL(url, context, force, dontExtract = None):
if os.path.exists(tmpFilename):
os.remove(tmpFilename)
- for i in xrange(maxRetries):
+ for i in range(maxRetries):
try:
context.downloader(url, tmpFilename)
break
@@ -993,7 +993,7 @@ if context.buildArgs:
def FormatBuildArguments(buildArgs):
s = ""
- for depName in sorted(buildArgs.iterkeys()):
+ for depName in sorted(buildArgs.keys()):
args = buildArgs[depName]
s += """
{name}: {args}""".format(
diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt
index 32b12a3d..581159ca 100644
--- a/documentation/CMakeLists.txt
+++ b/documentation/CMakeLists.txt
@@ -54,7 +54,7 @@ else()
endif()
-find_package(PythonInterp 2.6)
+find_package(PythonInterp 3.8)
# ReST - HTML documentation
if (DOCUTILS_FOUND AND PYTHONINTERP_FOUND)
diff --git a/documentation/processHtml.py b/documentation/processHtml.py
index 1a81df59..5e610ea8 100755
--- a/documentation/processHtml.py
+++ b/documentation/processHtml.py
@@ -25,9 +25,8 @@
import os
import sys
-import string
import re
-import HTMLParser
+import html.parser as HTMLParser
class HtmlToTextParser(HTMLParser.HTMLParser):
def __init__(self):
@@ -89,10 +88,10 @@ def ReadNavigationTemplate( filePath ):
try:
navFile = open( filePath, "r")
except IOError:
- print "Could not open file \'"+filePath+"\'"
+ print("Could not open file \'"+filePath+"\'")
with navFile:
- print "Navigation template: \'"+filePath+"\'"
+ print("Navigation template: \'"+filePath+"\'")
navHtml = navFile.read()
navHtml = StripHTMLComments(navHtml)
navFile.close()
@@ -109,7 +108,7 @@ def WriteIndexFile( outputFile, content ):
except:
pass
- print "Creating Search-Index File : \""+outputFile+"\""
+ print("Creating Search-Index File : \""+outputFile+"\"")
f = open(outputFile, "w")
f.write(content)
@@ -117,7 +116,7 @@ def WriteIndexFile( outputFile, content ):
#-------------------------------------------------------------------------------
def Usage():
- print str(sys.argv[0])+"