python/qemu/console_socket.py: Clarify type of drain_thread
authorJohn Snow <jsnow@redhat.com>
Tue, 6 Oct 2020 23:58:11 +0000 (19:58 -0400)
committerJohn Snow <jsnow@redhat.com>
Tue, 20 Oct 2020 13:37:57 +0000 (09:37 -0400)
Mypy needs just a little help to guess the type here.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 20201006235817.3280413-15-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
python/qemu/console_socket.py

index 39456825064aaf834d7742467e9ffc0167b0aeb1..d4669c441d05be254e1b0f104a1a4ab72ee5c0fb 100644 (file)
@@ -41,10 +41,9 @@ class ConsoleSocket(socket.socket):
         if file:
             self._logfile = open(file, "w")
         self._open = True
+        self._drain_thread = None
         if drain:
             self._drain_thread = self._thread_start()
-        else:
-            self._drain_thread = None
 
     def _drain_fn(self):
         """Drains the socket and runs while the socket is open."""