From: Guillaume Lambert Date: Thu, 27 May 2021 19:16:03 +0000 (+0200) Subject: Fix: conf.py imp import deprecation warning X-Git-Tag: v0.7.0~6 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=b8685a6d2e1ae1674cf6d77dcadce3e111aaa772;p=releng%2Fdocs-conf.git Fix: conf.py imp import deprecation warning According to https://docs.python.org/3/library/imp.html imp is deprecated in favor of importlib since python 3.4 and imp.find_module must be replaced by importlib.util.find_spec() Signed-off-by: Guillaume Lambert Change-Id: If3acf1b9aac6092a7a982598453d586316276dff --- diff --git a/docs_conf/conf.py b/docs_conf/conf.py index 0a62067..a2a7f2c 100644 --- a/docs_conf/conf.py +++ b/docs_conf/conf.py @@ -15,7 +15,7 @@ Configure sphinx-doc through an YAML file. """ import datetime -import imp +import importlib import os.path import sphinx_bootstrap_theme @@ -53,7 +53,7 @@ def collect_project_and_config(): project_cfg = local_config.get("project_cfg", None) - _, docs_path, _ = imp.find_module("docs_conf") + docs_path = importlib.util.find_spec("docs_conf").submodule_search_locations[0] default_cfg = os.path.join(docs_path, "defaults", "default.yaml") with open(os.path.join(docs_path, default_cfg), "r") as f: