python3: more 2 to 3 tool fixes
Changes exception statements to match python 3 style partial: https://github.com/vmware/pyvmomi/issues/55
This commit is contained in:
@@ -307,7 +307,7 @@ def __Login(host, port, user, pwd, service, adapter, version, path,
|
|||||||
content = si.RetrieveContent()
|
content = si.RetrieveContent()
|
||||||
except vmodl.MethodFault:
|
except vmodl.MethodFault:
|
||||||
raise
|
raise
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
# NOTE (hartsock): preserve the traceback for diagnostics
|
# NOTE (hartsock): preserve the traceback for diagnostics
|
||||||
# pulling and preserving the traceback makes diagnosing connection
|
# pulling and preserving the traceback makes diagnosing connection
|
||||||
# failures easier since the fault will also include where inside the
|
# failures easier since the fault will also include where inside the
|
||||||
|
@@ -1513,7 +1513,7 @@ class SessionOrientedStub(StubAdapterBase):
|
|||||||
time.sleep(self.retryDelay)
|
time.sleep(self.retryDelay)
|
||||||
retriesLeft -= 1
|
retriesLeft -= 1
|
||||||
continue
|
continue
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
if isinstance(e, self.SESSION_EXCEPTIONS):
|
if isinstance(e, self.SESSION_EXCEPTIONS):
|
||||||
# Our session might've timed out, change our state and retry.
|
# Our session might've timed out, change our state and retry.
|
||||||
self._SetStateUnauthenticated()
|
self._SetStateUnauthenticated()
|
||||||
|
Reference in New Issue
Block a user