summaryrefslogtreecommitdiff
path: root/git/remote.py
diff options
context:
space:
mode:
authorRam Rachum <ram@rachum.com>2020-06-12 19:00:36 +0300
committerSebastian Thiel <sebastian.thiel@icloud.com>2020-06-13 17:42:52 +0800
commit99ba753b837faab0509728ee455507f1a682b471 (patch)
tree5340a06b64d60550e66d509c92b78c9b018a6b00 /git/remote.py
parent4720e6337bb14f24ec0b2b4a96359a9460dadee4 (diff)
downloadgitpython-99ba753b837faab0509728ee455507f1a682b471.tar.gz
Fix exception causes in 7 modules
Diffstat (limited to 'git/remote.py')
-rw-r--r--git/remote.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/git/remote.py b/git/remote.py
index d4180134..37c0ccd3 100644
--- a/git/remote.py
+++ b/git/remote.py
@@ -146,8 +146,8 @@ class PushInfo(object):
# control character handling
try:
flags |= cls._flag_map[control_character]
- except KeyError:
- raise ValueError("Control character %r unknown as parsed from line %r" % (control_character, line))
+ except KeyError as e:
+ raise ValueError("Control character %r unknown as parsed from line %r" % (control_character, line)) from e
# END handle control character
# from_to handling
@@ -296,15 +296,15 @@ class FetchInfo(object):
try:
_new_hex_sha, _fetch_operation, fetch_note = fetch_line.split("\t")
ref_type_name, fetch_note = fetch_note.split(' ', 1)
- except ValueError: # unpack error
- raise ValueError("Failed to parse FETCH_HEAD line: %r" % fetch_line)
+ except ValueError as e: # unpack error
+ raise ValueError("Failed to parse FETCH_HEAD line: %r" % fetch_line) from e
# parse flags from control_character
flags = 0
try:
flags |= cls._flag_map[control_character]
- except KeyError:
- raise ValueError("Control character %r unknown as parsed from line %r" % (control_character, line))
+ except KeyError as e:
+ raise ValueError("Control character %r unknown as parsed from line %r" % (control_character, line)) from e
# END control char exception handling
# parse operation string for more info - makes no sense for symbolic refs, but we parse it anyway