diff --git a/doc/conf.py b/doc/conf.py index af76fe703bdc18dbf79f0726387c5fe947a994bb..a2a2ef0194b09435d7e208d0a33e2c16b438e197 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -99,7 +99,11 @@ def prepare(): ) os.environ.update(json.loads(out)) -prepare() +# Only the top-level import has the "builtins" __name__. This prevents +# re-running prepare() when conf.py is imported by the processes spawned by +# sphinx +if __name__ == 'builtins': + prepare() # -- General configuration ------------------------------------------------