time.clock() deprecated

Issue #23 resolved
Rasmus Olstedt created an issue

time.clock() has been removed in python 3.8. Apparently it’s been deprecated since 3.3.

According to the docs

The function time.clock() has been removed, after having been deprecated since Python 3.3: use time.perf_counter() or time.process_time() instead, depending on your requirements, to have well-defined behavior. (Contributed by Matthias Bussonnier in bpo-36895.)

Traceback (most recent call last):
  File "/home/rasmus/.config/blender/2.82/scripts/addons/import-daz/error.py", line 177, in execute
    self.run(context)
  File "/home/rasmus/.config/blender/2.82/scripts/addons/import-daz/daz.py", line 48, in run
    getMainAsset(self.filepath, context, self)
  File "/home/rasmus/.config/blender/2.82/scripts/addons/import-daz/main.py", line 115, in getMainAsset
    finishMain(filepath, t1)
  File "/home/rasmus/.config/blender/2.82/scripts/addons/import-daz/main.py", line 198, in finishMain
    t2 = time.clock()
AttributeError: module 'time' has no attribute 'clock'

location: <unknown location>:-1

Comments (2)

  1. Thomas Larsson repo owner

    Thanks for the info. I’m using the stable 2.82 and had not yet been hit by this. Checked that time.perf_counter works both with B2.82 and B.79

  2. Log in to comment