fix unbelievably dumb variable shadowing

pull/35/head
David Wilson 7 years ago
parent 6e3f0702a3
commit 1627164165

@ -12,7 +12,7 @@ mitogen Package
.. automodule:: mitogen
.. autodata:: mitogen.master
.. autodata:: mitogen.is_master
.. autodata:: mitogen.context_id
.. autodata:: mitogen.parent_id

@ -300,7 +300,7 @@ usual into the slave process.
context = mitogen.ssh.connect(broker, sys.argv[1])
context.call(install_app)
if __name__ == '__main__' and mitogen.master:
if __name__ == '__main__' and mitogen.is_master:
import mitogen.utils
mitogen.utils.run_with_broker(main)

@ -16,11 +16,11 @@ be expected. On the slave, it is built dynamically during startup.
#: context = mitogen.master.connect(broker)
#: context.call(do_work) # Causes slave to import __main__.
#:
#: if __name__ == '__main__' and mitogen.master:
#: if __name__ == '__main__' and mitogen.is_master:
#: import mitogen.utils
#: mitogen.utils.run_with_broker(main)
#:
master = True
is_master = True
#: This is ``0`` in a master, otherwise it is a master-generated ID unique to

@ -1128,7 +1128,7 @@ class ExternalContext(object):
mitogen.__package__ = 'mitogen'
mitogen.__path__ = []
mitogen.__loader__ = self.importer
mitogen.master = False
mitogen.is_master = False
mitogen.context_id = context_id
mitogen.parent_id = parent_id
mitogen.core = sys.modules['__main__']

@ -18,5 +18,5 @@ def main():
broker.shutdown()
broker.join()
if __name__ == '__main__' and mitogen.master:
if __name__ == '__main__' and mitogen.is_master:
main()

@ -33,5 +33,5 @@ def main(broker):
#context.call(mitogen.utils.log_to_file, '/tmp/log')
context.call(serve_django_app, 'webproject.settings')
if __name__ == '__main__' and mitogen.master:
if __name__ == '__main__' and mitogen.is_master:
mitogen.utils.run_with_broker(main)

Loading…
Cancel
Save