Deprecation Warning time.clock()

Bug #1830738 reported by claudio
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Python-Crypto
New
Undecided
Unassigned

Bug Description

There is a call to time.clock in Crypto/Random/_UserFriendlyRNG.py:77:
it causes the following warning, in the future may become a problem:
DeprecationWarning: time.clock has been deprecated in Python 3.3 and will be removed from Python 3.8: use time.perf_counter or time.process_time instead
  t = time.clock()

Revision history for this message
Al Smith (ajs1k) wrote :

This is now busted as time.clock() has been removed from python3.8.

s/time.clock/time.process_time/ and all is good again.

Revision history for this message
Al Smith (ajs1k) wrote :

Or perhaps this:

if 'process_time' in dir(time):
    t = time.process_time()
else:
    t = time.clock()

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.