diff --git a/pyVim/connect.py b/pyVim/connect.py index e468572a9..03681b398 100644 --- a/pyVim/connect.py +++ b/pyVim/connect.py @@ -312,7 +312,7 @@ def __Login(host, port, user, pwd, service, adapter, version, path, content = si.RetrieveContent() except vmodl.MethodFault: raise - except Exception, e: + except Exception as e: # NOTE (hartsock): preserve the traceback for diagnostics # pulling and preserving the traceback makes diagnosing connection # failures easier since the fault will also include where inside the diff --git a/pyVmomi/SoapAdapter.py b/pyVmomi/SoapAdapter.py index 8914bcdd7..19a0b1699 100644 --- a/pyVmomi/SoapAdapter.py +++ b/pyVmomi/SoapAdapter.py @@ -1513,7 +1513,7 @@ def InvokeAccessor(self, mo, info): time.sleep(self.retryDelay) retriesLeft -= 1 continue - except Exception, e: + except Exception as e: if isinstance(e, self.SESSION_EXCEPTIONS): # Our session might've timed out, change our state and retry. self._SetStateUnauthenticated()