]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
remove redundant code
authorSteve <steve.liushihao@gmail.com>
Mon, 22 Jan 2018 01:22:37 +0000 (18:22 -0700)
committerBen Darnell <ben@bendarnell.com>
Sat, 19 May 2018 23:54:08 +0000 (19:54 -0400)
tornado/autoreload.py
tornado/test/autoreload_test.py

index 38b3f8470f1b3c1e890f3e5f768f1b52f1ff27ee..345a1bda0bdeb04ec00e259d917840212d107735 100644 (file)
@@ -348,6 +348,5 @@ if __name__ == "__main__":
     # sys.path before our imports
     # Ensure that any global variables accessed by main() are in the module namespace
     # instead of the __main__ namespace
-    import tornado.autoreload
-    tornado.autoreload.main()
+    main()
 
index 44cb31397e020e2e701557669d07abc4976f8aa2..82d360c4399f0e173ec57ecbde65cde633d5bf41 100644 (file)
@@ -62,9 +62,8 @@ sys.stdout.flush()
 if 'TESTAPP_STARTED' not in os.environ:
     os.environ['TESTAPP_STARTED'] = '1'
 else:
-    # Force the autoreload to exit
-    autoreload.add_reload_hook(lambda: os._exit(0))
-    autoreload._reload()
+    # Avoid the autoreload to be caught by SystemExit
+    os._exit(0)
 """
 
         touch = """\