diff --git a/pyVmomi/VmomiSupport.py b/pyVmomi/VmomiSupport.py index da5196a43..c35694795 100644 --- a/pyVmomi/VmomiSupport.py +++ b/pyVmomi/VmomiSupport.py @@ -30,6 +30,11 @@ import pyVmomi.Iso8601 import base64 import threading + +if sys.version > '3': + # python3 removed long, it's the same as int + long = int + NoneType = type(None) try: from pyVmomi.pyVmomiSettings import allowGetSet @@ -358,7 +363,7 @@ def _InvokeMethod(info, self, *posargs, **kwargs): args = list(posargs) + [None] * (len(info.params) - len(posargs)) if len(kwargs) > 0: paramNames = [param.name for param in info.params] - for (k, v) in kwargs.items(): + for (k, v) in list(kwargs.items()): try: idx = paramNames.index(k) except ValueError: @@ -1332,7 +1337,7 @@ def InverseMap(map): vmodlNames = {} ## Add array type into special names -for name, typ in iteritems(vmodlTypes.copy()): +for name, typ in vmodlTypes.copy().items(): if typ is not NoneType: try: arrayType = typ.Array