mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Issue #11179: Make ccbench work under Python 3.1 and 2.7 again.
This commit is contained in:
commit
f5f6288bbc
2 changed files with 9 additions and 1 deletions
|
@ -169,6 +169,11 @@ Build
|
||||||
- Issue #11268: Prevent Mac OS X Installer failure if Documentation
|
- Issue #11268: Prevent Mac OS X Installer failure if Documentation
|
||||||
package had previously been installed.
|
package had previously been installed.
|
||||||
|
|
||||||
|
Tools/Demos
|
||||||
|
-----------
|
||||||
|
|
||||||
|
- Issue #11179: Make ccbench work under Python 3.1 and 2.7 again.
|
||||||
|
|
||||||
Tests
|
Tests
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
|
@ -276,7 +276,8 @@ def _recv(sock, n):
|
||||||
return sock.recv(n).decode('ascii')
|
return sock.recv(n).decode('ascii')
|
||||||
|
|
||||||
def latency_client(addr, nb_pings, interval):
|
def latency_client(addr, nb_pings, interval):
|
||||||
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sock:
|
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
|
try:
|
||||||
_time = time.time
|
_time = time.time
|
||||||
_sleep = time.sleep
|
_sleep = time.sleep
|
||||||
def _ping():
|
def _ping():
|
||||||
|
@ -289,6 +290,8 @@ def latency_client(addr, nb_pings, interval):
|
||||||
_sleep(interval)
|
_sleep(interval)
|
||||||
_ping()
|
_ping()
|
||||||
_sendto(sock, LAT_END + "\n", addr)
|
_sendto(sock, LAT_END + "\n", addr)
|
||||||
|
finally:
|
||||||
|
sock.close()
|
||||||
|
|
||||||
def run_latency_client(**kwargs):
|
def run_latency_client(**kwargs):
|
||||||
cmd_line = [sys.executable, '-E', os.path.abspath(__file__)]
|
cmd_line = [sys.executable, '-E', os.path.abspath(__file__)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue