Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions sphinxcontrib/versioning/sphinx_.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sys

from sphinx import application, locale
from sphinx.deprecation import _ModuleWrapper
from sphinx.cmd.build import build_main
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.config import Config as SphinxConfig
Expand Down Expand Up @@ -182,8 +183,13 @@ def _build(argv, config, versions, current_name, is_root):
:param str current_name: The ref name of the current version being built.
:param bool is_root: Is this build in the web root?
"""
# Patch.
application.Config = ConfigInject

# patch, if there are deprecations, patch hidden module object
if isinstance(application, _ModuleWrapper):
application._module.Config = ConfigInject
else:
application.Config = ConfigInject

if config.show_banner:
EventHandlers.BANNER_GREATEST_TAG = config.banner_greatest_tag
EventHandlers.BANNER_MAIN_VERSION = config.banner_main_ref
Expand All @@ -202,7 +208,6 @@ def _build(argv, config, versions, current_name, is_root):
if config.overflow:
argv += config.overflow

# Build.
result = build_main(argv)
if result != 0:
raise SphinxError
Expand Down