Match psutil port open checking behavior to that of socket test, and update tests. (#3589)

* Match psutil port open checking behavior to that of socket test, and update tests.

* Update docstring
This commit is contained in:
Erica Portnoy
2016-10-12 15:55:50 -07:00
committed by Brad Warren
parent 4d6bf49393
commit 20ac4aebaf
2 changed files with 19 additions and 8 deletions
+2 -1
View File
@@ -123,7 +123,8 @@ def already_listening_psutil(port, renewer=False):
return False
listeners = [conn.pid for conn in net_connections
if conn.status == 'LISTEN' and
if (conn.status == 'LISTEN' or
conn.status == 'TIME_WAIT') and
conn.type == socket.SOCK_STREAM and
conn.laddr[1] == port]
try: