Pārlūkot izejas kodu

tests: use dup-ed stdin in wait_on_fail

transport.close() (necessary to detach reader from the loop) will close
the FD. In case of stdin, it will prevent another call to this waiting
function. Use dup(2) to register cloned FD, which is safe to close
without side effects.
Marek Marczykowski-Górecki 3 gadi atpakaļ
vecāks
revīzija
79fb0cade1
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      qubes/tests/__init__.py

+ 1 - 1
qubes/tests/__init__.py

@@ -249,7 +249,7 @@ def wait_on_fail(func):
             transport, protocol = self.loop.run_until_complete(
                 self.loop.connect_read_pipe(
                     lambda: asyncio.StreamReaderProtocol(reader),
-                    sys.stdin))
+                    os.fdopen(os.dup(sys.stdin.fileno()))))
             self.loop.run_until_complete(reader.readline())
             transport.close()
             raise