Kaynağa Gözat

shutdown called itself instead of async_shutdown

digital 7 yıl önce
ebeveyn
işleme
f0d91bda32
1 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  1. 3 2
      network/__init__.py

+ 3 - 2
network/__init__.py

@@ -271,7 +271,8 @@ class Server(object):
         # list of all active connection handlers
         self.connection_handler = []
         # register our cleanup method to be executed when the program exits.
-        # the cleanup function unregisters itself, so it won't get executed twice when the user called it befor the program exites
+        # the cleanup function unregisters itself, so it won't get executed
+        # twice when the user called it befor the program exites
         atexit.register(self.shutdown)
 
     def make_socket(self):
@@ -323,7 +324,7 @@ class Server(object):
         this method can be called synchronous and calls the asynchronous
         shutdown method.
         """
-        curio.run(self.shutdown)
+        curio.run(self.async_shutdown)
 
     async def async_shutdown(self):
         """