From efde3a577336d39bf9b514278506042ffc9313db Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 22 Jul 2020 02:02:20 -0400 Subject: [PATCH] Simplify the `_child.py` script We don't really need stdin for anything but passing the entry point and detaching it seemed to just cause errors on cancellation teardown. --- tractor/_child.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tractor/_child.py b/tractor/_child.py index adad3c5..b4d1d60 100644 --- a/tractor/_child.py +++ b/tractor/_child.py @@ -3,11 +3,4 @@ import trio import cloudpickle if __name__ == "__main__": - job = cloudpickle.load(sys.stdin.detach()) - - try: - result = trio.run(job) - cloudpickle.dump(sys.stdout.detach(), result) - - except BaseException as err: - cloudpickle.dump(sys.stdout.detach(), err) \ No newline at end of file + trio.run(cloudpickle.load(sys.stdin.buffer))