Skip to content
This repository was archived by the owner on Nov 8, 2020. It is now read-only.

Commit f47d575

Browse files
committed
Fix failed with Sphinx-2.0.1
1 parent 5681279 commit f47d575

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changelog
22
==========
33

4+
1.0.1 (unreleased)
5+
-------------------
6+
- Support Sphinx-2.0.1
7+
48
1.0.0 (2019-01-27)
59
-------------------
610
- Support Sphinx-2.0 (unreleased yet)

src/sphinx_testing/util.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,13 @@ def __init__(self, srcdir=None, confdir=None, outdir=None, doctreedir=None,
8484
if warning is None:
8585
warning = StringIO()
8686

87+
# unwrap ModuleWrapper (deprecated_alias)
88+
application = sphinx.application
89+
while hasattr(application, '_module'):
90+
application = application._module
91+
8792
try:
88-
sphinx.application.abspath = lambda x: x
93+
application.abspath = lambda x: x
8994
if sphinx_version < '1.3':
9095
Sphinx.__init__(self, srcdir, confdir, outdir, doctreedir,
9196
buildername, confoverrides, status,
@@ -96,7 +101,7 @@ def __init__(self, srcdir=None, confdir=None, outdir=None, doctreedir=None,
96101
warning, freshenv, warningiserror, tags,
97102
verbosity, parallel)
98103
finally:
99-
sphinx.application.abspath = os.path.abspath
104+
application.abspath = os.path.abspath
100105

101106
def __repr__(self):
102107
classname = self.__class__.__name__

0 commit comments

Comments
 (0)