Skip to content

Commit

Permalink
fix #484: compatibility with python3.8 in petl.timings.clock()
Browse files Browse the repository at this point in the history
  • Loading branch information
juarezr committed Sep 12, 2020
1 parent a66a640 commit 5825211
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion docs/changes.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
Changes
=======

Version 1.6.6
-------------

* fix compatibility with python3.8 in `petl.timings.clock()`.
By :user:`juarezr`, :issue:`484`.


Version 1.6.5
-------------

* Fixed fromxlsx with read_only crashes.
By :user:`juarezr`, :issue:`514`.



Version 1.6.4
-------------

Expand Down
5 changes: 3 additions & 2 deletions petl/util/timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import time


from petl.compat import PY3
from petl.util.base import Table
from petl.util.statistics import onlinestats

Expand Down Expand Up @@ -246,11 +247,11 @@ def __iter__(self):
self.time = 0
it = iter(self.wrapped)
while True:
before = time.clock()
before = time.perf_counter() if PY3 else time.clock()
try:
row = next(it)
except StopIteration:
return
after = time.clock()
after = time.perf_counter() if PY3 else time.clock()
self.time += (after - before)
yield row

0 comments on commit 5825211

Please sign in to comment.