time.clock() is removed in Python 3.8

Two more places where `time.clock()` is called. Adopt the imports accordingly.
This commit is contained in:
topic2k
2019-09-15 12:55:34 +02:00
parent 4a506f82a6
commit 873fd00a41
2 changed files with 10 additions and 4 deletions

View File

@@ -7,7 +7,10 @@ this is very old-style code: don't imitate it!
"""
from time import clock
try:
from time import process_time as clock
except ImportError:
from time import clock
import wx
print(wx.VERSION_STRING)
from numpy import *

View File

@@ -98,7 +98,10 @@ __date__ = "31 March 2009"
import wx
# just for isinstance
import time
try:
from time import time, process_time as clock
except ImportError:
from time import time, clock
import warnings
import six
@@ -4751,8 +4754,8 @@ class AuiManager(wx.EvtHandler):
# if the pane's name identifier is blank, create a random string
if pinfo.name == "" or already_exists:
pinfo.name = ("%s%08x%08x%08x") % (pinfo.window.GetName(), int(time.time()),
int(time.clock()), len(self._panes))
pinfo.name = ("%s%08x%08x%08x") % (pinfo.window.GetName(), int(time()),
int(clock()), len(self._panes))
# set initial proportion (if not already set)
if pinfo.dock_proportion == 0: