Skip to content

Commit 137e2d5

Browse files
committed
Fixed inadvertent use of a Sphinx 1.8+ event
Fixes #59.
1 parent e918e7c commit 137e2d5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
UNRELEASED
2-
==========
1+
1.5.1
2+
=====
33

44
* Fixed escape characters in parameter default values getting lost during signature processing
5+
* Replaced use of the ``config-inited`` event (which inadvertently required Sphinx 1.8) with the
6+
``builder-inited`` event
57

68

79
1.5.0

sphinx_autodoc_typehints.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,14 @@ def process_docstring(app, what, name, obj, options, lines):
218218
break
219219

220220

221-
def config_ready(app, config):
222-
if config.set_type_checking_flag:
221+
def builder_ready(app):
222+
if app.config.set_type_checking_flag:
223223
typing.TYPE_CHECKING = True
224224

225225

226226
def setup(app):
227-
app.add_config_value('set_type_checking_flag', True, 'html')
228-
app.connect('config-inited', config_ready)
227+
app.add_config_value('set_type_checking_flag', False, 'html')
228+
app.connect('builder-inited', builder_ready)
229229
app.connect('autodoc-process-signature', process_signature)
230230
app.connect('autodoc-process-docstring', process_docstring)
231231
return dict(parallel_read_safe=True)

0 commit comments

Comments
 (0)