Commits

Denis Bilenko committed 42292da

server: rename kill() method to close()

"kill" is available as a deprecated alias

  • Participants
  • Parent commits bc7be40

Comments (0)

Files changed (2)

File gevent/baseserver.py

             self.kill()
             raise
 
-    def kill(self):
+    def close(self):
         """Close the listener socket and stop accepting."""
         self.started = False
         try:
             self.__dict__.pop('socket', None)
             self.__dict__.pop('handle', None)
 
+    kill = close   # this is deprecated
+
     def stop(self, timeout=None):
         """Stop accepting the connections and close the listening socket.
 

File gevent/server.py

         if self.pool is not None:
             self.pool._semaphore.rawlink(self._start_accepting_if_started)
 
-    def kill(self):
+    def close(self):
         try:
-            BaseServer.kill(self)
+            BaseServer.close(self)
         finally:
             self.__dict__.pop('_handle', None)
             pool = getattr(self, 'pool', None)
             if pool is not None:
                 pool._semaphore.unlink(self._start_accepting_if_started)
 
+    kill = close  # this is deprecated
+
     def pre_start(self):
         BaseServer.pre_start(self)
         # make SSL work:
                 self.loop.handle_error((address, self), *sys.exc_info())
                 ex = sys.exc_info()[1]
                 if self.is_fatal_error(ex):
-                    self.kill()
+                    self.close()
                     sys.stderr.write('ERROR: %s failed with %s\n' % (self, str(ex) or repr(ex)))
                     return
                 if self.delay >= 0: