summaryrefslogtreecommitdiff
path: root/pylint/checkers/utils.py
diff options
context:
space:
mode:
authorRam Rachum <ram@rachum.com>2020-06-12 13:19:46 +0300
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2020-06-14 08:28:01 +0200
commit7bf11769db270b828280433fcffe15ecaf196e4d (patch)
tree66b26bf36f5f37e27344d4d6399fc3ae328a5c52 /pylint/checkers/utils.py
parent201daa6f77a6ea2c630629cb7a944f341b46a454 (diff)
downloadpylint-git-7bf11769db270b828280433fcffe15ecaf196e4d.tar.gz
Fix exception causes all over the codebase
Diffstat (limited to 'pylint/checkers/utils.py')
-rw-r--r--pylint/checkers/utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py
index d7e6a6aa7..941b0f69b 100644
--- a/pylint/checkers/utils.py
+++ b/pylint/checkers/utils.py
@@ -533,8 +533,8 @@ def parse_format_string(
def split_format_field_names(format_string) -> Tuple[str, Iterable[Tuple[bool, str]]]:
try:
return _string.formatter_field_name_split(format_string)
- except ValueError:
- raise IncompleteFormatString()
+ except ValueError as e:
+ raise IncompleteFormatString() from e
def collect_string_fields(format_string) -> Iterable[Optional[str]]:
@@ -566,7 +566,7 @@ def collect_string_fields(format_string) -> Iterable[Optional[str]]:
yield ""
yield "1"
return
- raise IncompleteFormatString(format_string)
+ raise IncompleteFormatString(format_string) from exc
def parse_format_method_string(
@@ -591,8 +591,8 @@ def parse_format_method_string(
explicit_pos_args.add(str(keyname))
try:
keyword_arguments.append((keyname, list(fielditerator)))
- except ValueError:
- raise IncompleteFormatString()
+ except ValueError as e:
+ raise IncompleteFormatString() from e
else:
implicit_pos_args_cnt += 1
return keyword_arguments, implicit_pos_args_cnt, len(explicit_pos_args)