aboutsummaryrefslogtreecommitdiffstats
path: root/docs/conf.py
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2023-06-04 20:34:14 +0100
committerGravatar GitHub <[email protected]>2023-06-04 20:34:14 +0100
commit1a362c04eb4d5d8f3c531a590d73cf5d7300ace8 (patch)
treeaccbe4d840b036dcc9502eed395f19400f5ad9a3 /docs/conf.py
parentMerge pull request #175 from python-discord/log-when-waiting-for-guild-to-be-... (diff)
parentAdd changelog entry for ruff migration (diff)
Merge pull request #176 from python-discord/ruff-migration
Ruff migration
Diffstat (limited to 'docs/conf.py')
-rw-r--r--docs/conf.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 2fea7264..23636774 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,6 +1,7 @@
# Configuration file for the Sphinx documentation builder.
# https://www.sphinx-doc.org/en/master/usage/configuration.html
+import contextlib
import functools
import os.path
import shutil
@@ -16,7 +17,7 @@ from sphinx.application import Sphinx
logger = sphinx.util.logging.getLogger(__name__)
# Handle the path not being set correctly in actions.
-sys.path.insert(0, os.path.abspath('..'))
+sys.path.insert(0, os.path.abspath(".."))
from docs import utils # noqa: E402
@@ -209,10 +210,9 @@ smv_latest_version = "main"
smv_branch_whitelist = "main"
if os.getenv("BUILD_DOCS_FOR_HEAD", "False").lower() == "true":
if not (branch := os.getenv("BRANCH_NAME")):
- try:
+ with contextlib.suppress(git.InvalidGitRepositoryError):
branch = git.Repo(PROJECT_ROOT).active_branch.name
- except git.InvalidGitRepositoryError:
- pass
+
if branch:
logger.info(f"Adding branch {branch} to build whitelist.")