Skip to content

Commit 87f49fe

Browse files
author
ddraganov
committed
Python 3.8+ support - Use time.perf_counter() instead of time.clock()
1 parent fce1d64 commit 87f49fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

samples/vminfo_quick.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
1212
"""
1313
import atexit
14-
from time import clock
14+
try:
15+
# Python 3.8 : time.clock was deprecated and removed.
16+
from time import perf_counter as clock
17+
except ImportError:
18+
from time import clock
1519
from pyVmomi import vim
1620
from tools import cli, service_instance, pchelper
1721

0 commit comments

Comments
 (0)