Skip to content

Commit

Permalink
test: make probe_ports a class method under python2.
Browse files Browse the repository at this point in the history
  • Loading branch information
rouilj committed Jan 1, 2025
1 parent 819669f commit 457da4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/wsgi_liveserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def _post_teardown(self):
self._thread.join()
del self._server

def probe_ports(start=port_range[0], end=port_range[1]):
@classmethod
def probe_ports(cls, start=port_range[0], end=port_range[1]):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
port = start
Expand Down

0 comments on commit 457da4d

Please sign in to comment.