commandserver: close selector explicitly
authorJun Wu <quark@fb.com>
Sun, 16 Jul 2017 04:39:32 -0700
changeset 33506 8a1a7935c047
parent 33505 389536aff376
child 33507 e9672de52a23
commandserver: close selector explicitly The selector does not have a __del__ method and needs a manual close. We can also use "with selector" but that makes the code too indented. Therefore append a "selector.close()" after the end of the main loop for now.
mercurial/commandserver.py
--- a/mercurial/commandserver.py	Sat Jul 15 15:01:29 2017 +0900
+++ b/mercurial/commandserver.py	Sun Jul 16 04:39:32 2017 -0700
@@ -519,6 +519,7 @@
                         self.ui.traceback(force=True)
                     finally:
                         os._exit(255)
+        selector.close()
 
     def _sigchldhandler(self, signal, frame):
         self._reapworkers(os.WNOHANG)