From 775448c792c16a62cd9ba085da7662466cf04552 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Fri, 24 Jan 2020 10:33:28 +0700 Subject: [PATCH] docs: Make Python 3 compatible --- docs/build_docs.py | 4 ++-- docs/idf_extensions/esp_err_definitions.py | 2 +- docs/idf_extensions/gen_toolchain_links.py | 2 +- docs/idf_extensions/gen_version_specific_includes.py | 2 +- docs/idf_extensions/kconfig_reference.py | 2 +- docs/idf_extensions/run_doxygen.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/build_docs.py b/docs/build_docs.py index 9dc902f69..6d0b6420d 100755 --- a/docs/build_docs.py +++ b/docs/build_docs.py @@ -188,9 +188,9 @@ def sphinx_call(language, target, build_dir, sphinx_parallel_jobs, buildername): # and sphinx.cmd.build() also does a lot of work in the calling thread, especially for j ==1, # so using a Pyhthon thread for this part is a poor option (GIL) p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - for c in iter(lambda: p.stdout.readline(), ''): + for c in iter(lambda: p.stdout.readline(), b''): sys.stdout.write(prefix) - sys.stdout.write(c) + sys.stdout.write(c.decode('utf-8')) ret = p.wait() assert (ret is not None) sys.stdout.flush() diff --git a/docs/idf_extensions/esp_err_definitions.py b/docs/idf_extensions/esp_err_definitions.py index c77ff5bb7..f8a80b2c5 100644 --- a/docs/idf_extensions/esp_err_definitions.py +++ b/docs/idf_extensions/esp_err_definitions.py @@ -1,5 +1,5 @@ # Extension to generate esp_err definition as .rst -from util import copy_if_modified, call_with_python +from .util import copy_if_modified, call_with_python def setup(app): diff --git a/docs/idf_extensions/gen_toolchain_links.py b/docs/idf_extensions/gen_toolchain_links.py index 183e39f81..64699f9f1 100644 --- a/docs/idf_extensions/gen_toolchain_links.py +++ b/docs/idf_extensions/gen_toolchain_links.py @@ -2,7 +2,7 @@ from __future__ import print_function import os.path from collections import namedtuple -from util import copy_if_modified +from .util import copy_if_modified BASE_URL = 'https://dl.espressif.com/dl/' diff --git a/docs/idf_extensions/gen_version_specific_includes.py b/docs/idf_extensions/gen_version_specific_includes.py index 483f94c84..fae92512b 100755 --- a/docs/idf_extensions/gen_version_specific_includes.py +++ b/docs/idf_extensions/gen_version_specific_includes.py @@ -7,7 +7,7 @@ from __future__ import print_function from __future__ import unicode_literals from io import open -from util import copy_if_modified +from .util import copy_if_modified import subprocess import os import re diff --git a/docs/idf_extensions/kconfig_reference.py b/docs/idf_extensions/kconfig_reference.py index 2176683e2..3ca9c7913 100644 --- a/docs/idf_extensions/kconfig_reference.py +++ b/docs/idf_extensions/kconfig_reference.py @@ -3,7 +3,7 @@ import os.path import sys import subprocess -from util import copy_if_modified +from .util import copy_if_modified def setup(app): diff --git a/docs/idf_extensions/run_doxygen.py b/docs/idf_extensions/run_doxygen.py index 7c3a6d21a..32856ab66 100644 --- a/docs/idf_extensions/run_doxygen.py +++ b/docs/idf_extensions/run_doxygen.py @@ -7,7 +7,7 @@ import os import os.path import re import subprocess -from util import copy_if_modified +from .util import copy_if_modified ALL_KINDS = [ ("function", "Functions"),