psf / pyperf

Toolkit to run Python benchmarks
http://pyperf.readthedocs.io/
MIT License
799 stars 78 forks source link

python3.8 time.clock is no longer available #62

Closed scarabeusiv closed 4 years ago

scarabeusiv commented 4 years ago
[   24s] >       elif pyperf.perf_counter == time.clock:
[   24s] E       AttributeError: module 'time' has no attribute 'clock'
[   24s] 
[   24s] pyperf/_collect_metadata.py:95: AttributeError

With python 3.8 this errors out, I suppose there shoudl be hassattr check like on the perf_counter first check.

vstinner commented 4 years ago

Do you want to work on a fix? You can check hasattr() to skip this code path on Python 3.8 and newer.

scarabeusiv commented 4 years ago

I can provide the patch if you want and agree that the hasattr makes sense :-)

We just finally integrated python 3.8 in openSUSE and I am checking leaf packages and their testsuites.

vstinner commented 4 years ago

hasattr() is fine.