Add script "guards" to docs examples

This was originally bundled in #102 but the windows CI there has blocked
that from landing quickly. These examples need to be fixed stat since
I've had at least a couple people notice it now when first trying out
the project.
fix_examples_in_docs
Tyler Goodlet 2020-02-07 00:23:48 -05:00
parent 5741bd5209
commit d8daa57a33
1 changed files with 5 additions and 2 deletions

View File

@ -146,7 +146,8 @@ the hip new film we're shooting:
print("CUTTTT CUUTT CUT!!! Donny!! You're supposed to say...")
tractor.run(main)
if __name__ == '__main__':
tractor.run(main)
We spawn two *actors*, *donny* and *gretchen*.
@ -192,7 +193,9 @@ and use the ``run_in_actor()`` method:
print(await portal.result())
tractor.run(main)
if __name__ == '__main__':
tractor.run(main)
What's going on?