Skip to content

Commit

Permalink
python3: fix some syntax errors
Browse files Browse the repository at this point in the history
partial: vmware#55
  • Loading branch information
kevin1024 authored and hartsock committed Jul 28, 2014
1 parent f93ddf9 commit 66e515b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pyVmomi/VmomiSupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@
from six import itervalues
from six import text_type
from six import PY3
if PY3:
long = int
basestring = str

from datetime import datetime
import pyVmomi.Iso8601
import base64
import threading

if PY3:
# python3 removed long, it's the same as int
long = int
# python3 removed basestring, use str instead.
basestring = str

NoneType = type(None)
try:
from pyVmomi.pyVmomiSettings import allowGetSet
Expand Down Expand Up @@ -358,7 +361,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:
Expand Down Expand Up @@ -1332,7 +1335,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
Expand Down

0 comments on commit 66e515b

Please sign in to comment.