summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes/test
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-10-17 21:46:45 (GMT)
committerGitHub <noreply@github.com>2017-10-17 21:46:45 (GMT)
commit884d13a55fc328e2e1e3948a82b361b30804b818 (patch)
tree8b68f04b9261c26d4f2f5ed7a7beaa1d31c236c0 /Lib/ctypes/test
parentde86073a761cd3539aaca6f886a1f55effc0d9da (diff)
downloadcpython-884d13a55fc328e2e1e3948a82b361b30804b818.zip
cpython-884d13a55fc328e2e1e3948a82b361b30804b818.tar.gz
cpython-884d13a55fc328e2e1e3948a82b361b30804b818.tar.bz2
time.clock() now emits a DeprecationWarning (GH-4020)
bpo-31803: time.clock() and time.get_clock_info('clock') now emit a DeprecationWarning warning. Replace time.clock() with time.perf_counter() in tests and demos. Remove also hasattr(time, 'monotonic') in test_time since time.monotonic() is now always available since Python 3.5.
Diffstat (limited to 'Lib/ctypes/test')
-rw-r--r--Lib/ctypes/test/test_numbers.py2
-rw-r--r--Lib/ctypes/test/test_strings.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/ctypes/test/test_numbers.py b/Lib/ctypes/test/test_numbers.py
index ba4f563..09eef90 100644
--- a/Lib/ctypes/test/test_numbers.py
+++ b/Lib/ctypes/test/test_numbers.py
@@ -241,7 +241,7 @@ class c_int_S(_SimpleCData):
def run_test(rep, msg, func, arg=None):
## items = [None] * rep
items = range(rep)
- from time import clock
+ from time import perf_counter as clock
if arg is not None:
start = clock()
for i in items:
diff --git a/Lib/ctypes/test/test_strings.py b/Lib/ctypes/test/test_strings.py
index c7bfbda..e28e141 100644
--- a/Lib/ctypes/test/test_strings.py
+++ b/Lib/ctypes/test/test_strings.py
@@ -194,7 +194,7 @@ class WStringTestCase(unittest.TestCase):
def run_test(rep, msg, func, arg):
items = range(rep)
- from time import clock
+ from time import perf_counter as clock
start = clock()
for i in items:
func(arg); func(arg); func(arg); func(arg); func(arg)