# HG changeset patch # User Marcin Kuzminski # Date 2018-10-10 10:21:17 # Node ID 0cd102ec3898ad0771f3773600081a4904bb8ed6 # Parent 91fdedb62c816ea5a44e58c8deeeae6ded30442c exceptions: use python3 compatible exception handling diff --git a/vcsserver/git.py b/vcsserver/git.py --- a/vcsserver/git.py +++ b/vcsserver/git.py @@ -56,9 +56,11 @@ def reraise_safe_exceptions(func): return func(*args, **kwargs) except (ChecksumMismatch, WrongObjectException, MissingCommitError, ObjectMissing) as e: - raise exceptions.LookupException(e)(e.message) + exc = exceptions.LookupException(e) + raise exc(e) except (HangupException, UnexpectedCommandError) as e: - raise exceptions.VcsException(e)(e.message) + exc = exceptions.VcsException(e) + raise exc(e) except Exception as e: # NOTE(marcink): becuase of how dulwich handles some exceptions # (KeyError on empty repos), we cannot track this and catch all