Psionman
Psionman

Reputation: 3677

Sphinx automodule runs my code

If I include the following document

The xxx API reference
===============================

.. automodule:: sphinx_test
   :members:

in my Sphinx documentation it runs the module sphinx_test.py every time I 'make html'

Is this normal? Is there a flag somewhere to turn off this behaviour that I'm missing?

Upvotes: 0

Views: 190

Answers (1)

Psionman
Psionman

Reputation: 3677

In this case, it was because I was running a wxPython app and my

screen_app = wx.App()
main_frame = MainFrame()
screen_app.MainLoop()

code was not protected by

if __name__ == "__main__":

Thanks Paebbels for the hint

Upvotes: 1

Related Questions