File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 3838import reframe # noqa: F401, F403
3939import reframe .utility .osext as osext # noqa: F401, F403
4040
41+ # Sphinx erroneously uses `repr()` to display values and not the
42+ # human-readable `str()`. For this reason we define the following variable in
43+ # the `reframe` module so that objects can redirect to their `str()` method
44+ # from `repr()` if they are invoked in the context of Sphinx when building the
45+ # documentation. See discussion and the related workaround here:
46+ #
47+ # https://github.com/sphinx-doc/sphinx/issues/3857
48+
49+ reframe .__build_docs__ = True
50+
4151# -- General configuration ------------------------------------------------
4252
4353# If your documentation needs a minimal Sphinx version, state it here.
Original file line number Diff line number Diff line change @@ -346,6 +346,10 @@ def __str__(self):
346346 return str (self ._default_value )
347347
348348 def __repr__ (self ):
349+ import reframe
350+ if hasattr (reframe , '__build_docs__' ):
351+ return str (self )
352+
349353 try :
350354 name = self .name
351355 except AttributeError :
You can’t perform that action at this time.
0 commit comments