mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fix some ResourceErrors.
Use a context manager for os.popen and explicitly close a socket.
This commit is contained in:
parent
d4694ed1bb
commit
50be1ca55e
2 changed files with 7 additions and 2 deletions
|
@ -1260,7 +1260,11 @@ class _TestManagerRestart(BaseTestCase):
|
|||
authkey = os.urandom(32)
|
||||
manager = QueueManager(
|
||||
address=('localhost', 0), authkey=authkey, serializer=SERIALIZER)
|
||||
addr = manager.get_server().address
|
||||
srvr = manager.get_server()
|
||||
addr = srvr.address
|
||||
# Close the connection.Listener socket which gets opened as a part
|
||||
# of manager.get_server(). It's not needed for the test.
|
||||
srvr.listener.close()
|
||||
manager.start()
|
||||
|
||||
p = self.Process(target=self._putter, args=(manager.address, authkey))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue