Skip to content

Commit dd3d7ff

Browse files
committed
Fixed deprecated features (at least since Python v3.3)
1 parent 98fc1c3 commit dd3d7ff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

guidata/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import os
2222
import os.path as osp
2323
import locale # Warning: 2to3 false alarm ('import' fixer)
24-
import collections
24+
import collections.abc
2525

2626
# Local imports
2727
from guidata.userconfig import get_home_dir
@@ -185,7 +185,7 @@ def assert_interface_supported(klass, iface):
185185
for name, func in list(iface.__dict__.items()):
186186
if name == "__inherits__":
187187
continue
188-
if isinstance(func, collections.Callable):
188+
if isinstance(func, collections.abc.Callable):
189189
assert hasattr(klass, name), "Attribute %s missing from %r" % (name, klass)
190190
imp_func = getattr(klass, name)
191191
imp_code = imp_func.__code__
@@ -270,11 +270,11 @@ def __init__(self):
270270
def tic(self, cat):
271271
"""Starting timer"""
272272
print(">", cat)
273-
self.t0_dict[cat] = time.clock()
273+
self.t0_dict[cat] = time.perf_counter()
274274

275275
def toc(self, cat, msg="delta:"):
276276
"""Stopping timer"""
277-
print("<", cat, ":", msg, time.clock() - self.t0_dict[cat])
277+
print("<", cat, ":", msg, time.perf_counter() - self.t0_dict[cat])
278278

279279

280280
_TIMER = Timer()

0 commit comments

Comments
 (0)