14
0
forked from pool/python-pyperf
Files
python-pyperf/python38.patch
Tomáš Chvátal 0d42012e1b - Add patches to work with py3.8:
* python-retcode.patch
 * python38.patch

- Update to 1.7.0:
  * metadata: add ``python_compiler``
  * Windows: inherit ``SystemDrive`` environment variable by default.
  * Fix tests on ARM and PPC: cpu_model_name metadata is no longer required
    on Linux.
  * tests: Do not allow test suite to execute without unittest2 on Python2,
    otherwise man failures occur due to missing 'assertRegex'.
  * doc: Update old/dead links.
  * Travis CI: drop Python 3.4 support.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyperf?expand=0&rev=3
2020-03-09 10:44:29 +00:00

15 lines
700 B
Diff

Index: pyperf-1.7.0/pyperf/_collect_metadata.py
===================================================================
--- pyperf-1.7.0.orig/pyperf/_collect_metadata.py
+++ pyperf-1.7.0/pyperf/_collect_metadata.py
@@ -92,7 +92,8 @@ def collect_python_metadata(metadata):
metadata['timer'] = ('%s, resolution: %s'
% (info.implementation,
format_timedelta(info.resolution)))
- elif pyperf.perf_counter == time.clock:
+ elif (hasattr(time, 'clock')
+ and pyperf.perf_counter == time.clock):
metadata['timer'] = 'time.clock()'
elif pyperf.perf_counter == time.time:
metadata['timer'] = 'time.time()'