mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Improve support for deprecated builders without env arg (#10702)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
cc1f6cb9f4
commit
9845500ffa
@ -89,10 +89,11 @@ class Builder:
|
||||
self.env: BuildEnvironment = env
|
||||
self.env.set_versioning_method(self.versioning_method,
|
||||
self.versioning_compare)
|
||||
elif env is not Ellipsis:
|
||||
else:
|
||||
# ... is passed by SphinxComponentRegistry.create_builder to not show two warnings.
|
||||
warnings.warn("The 'env' argument to Builder will be required from Sphinx 7.",
|
||||
RemovedInSphinx70Warning, stacklevel=2)
|
||||
self.env = None
|
||||
self.events: EventManager = app.events
|
||||
self.config: Config = app.config
|
||||
self.tags: Tags = app.tags
|
||||
|
@ -166,7 +166,7 @@ class SphinxComponentRegistry:
|
||||
f"'env'argument. Report this bug to the developers of your custom builder, "
|
||||
f"this is likely not a issue with Sphinx. The 'env' argument will be required "
|
||||
f"from Sphinx 7.", RemovedInSphinx70Warning, stacklevel=2)
|
||||
builder = self.builders[name](app, env=...) # type: ignore[arg-type]
|
||||
builder = self.builders[name](app)
|
||||
if env is not None:
|
||||
builder.set_environment(env)
|
||||
return builder
|
||||
|
Loading…
Reference in New Issue
Block a user