Moved twisted/reactor.py to platform/twistedreactor.py.
twistedreactor.py:
- cleaned up logging
- don't try to crash if stop has been called (uses _running to check it)
- don't add reader and writers if they've already been added
- use a NullContext when calling add_handler
- call IOLoop.close() to properly close file descriptors
- implement run() and instruct the reactor to not install signal handlers.
import_test.py:
- import twistedreactor too
twistedreactor_test.py:
- do conditional includes based on twisted
- remove superfluous logging
- don't use assertGreater
- use threading instead of the thread module. Join threads at the end of test.
- properly close the file descriptor in Reader/Writer's connectionLost().
- make use of tornado.platform.auto's set_close_exec.
- write only one in the pipe, and check for that.