Commit 1f99dcb4 authored by David Wilson's avatar David Wilson

fix unbelievably dumb variable shadowing

parent 25e4724b
...@@ -12,7 +12,7 @@ mitogen Package ...@@ -12,7 +12,7 @@ mitogen Package
.. automodule:: mitogen .. automodule:: mitogen
.. autodata:: mitogen.master .. autodata:: mitogen.is_master
.. autodata:: mitogen.context_id .. autodata:: mitogen.context_id
.. autodata:: mitogen.parent_id .. autodata:: mitogen.parent_id
......
...@@ -300,7 +300,7 @@ usual into the slave process. ...@@ -300,7 +300,7 @@ usual into the slave process.
context = mitogen.ssh.connect(broker, sys.argv[1]) context = mitogen.ssh.connect(broker, sys.argv[1])
context.call(install_app) context.call(install_app)
if __name__ == '__main__' and mitogen.master: if __name__ == '__main__' and mitogen.is_master:
import mitogen.utils import mitogen.utils
mitogen.utils.run_with_broker(main) mitogen.utils.run_with_broker(main)
......
...@@ -16,11 +16,11 @@ be expected. On the slave, it is built dynamically during startup. ...@@ -16,11 +16,11 @@ be expected. On the slave, it is built dynamically during startup.
#: context = mitogen.master.connect(broker) #: context = mitogen.master.connect(broker)
#: context.call(do_work) # Causes slave to import __main__. #: 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 #: import mitogen.utils
#: mitogen.utils.run_with_broker(main) #: 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 #: This is ``0`` in a master, otherwise it is a master-generated ID unique to
......
...@@ -1128,7 +1128,7 @@ class ExternalContext(object): ...@@ -1128,7 +1128,7 @@ class ExternalContext(object):
mitogen.__package__ = 'mitogen' mitogen.__package__ = 'mitogen'
mitogen.__path__ = [] mitogen.__path__ = []
mitogen.__loader__ = self.importer mitogen.__loader__ = self.importer
mitogen.master = False mitogen.is_master = False
mitogen.context_id = context_id mitogen.context_id = context_id
mitogen.parent_id = parent_id mitogen.parent_id = parent_id
mitogen.core = sys.modules['__main__'] mitogen.core = sys.modules['__main__']
......
...@@ -18,5 +18,5 @@ def main(): ...@@ -18,5 +18,5 @@ def main():
broker.shutdown() broker.shutdown()
broker.join() broker.join()
if __name__ == '__main__' and mitogen.master: if __name__ == '__main__' and mitogen.is_master:
main() main()
...@@ -33,5 +33,5 @@ def main(broker): ...@@ -33,5 +33,5 @@ def main(broker):
#context.call(mitogen.utils.log_to_file, '/tmp/log') #context.call(mitogen.utils.log_to_file, '/tmp/log')
context.call(serve_django_app, 'webproject.settings') 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) mitogen.utils.run_with_broker(main)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment