Skip to content

Commit

Permalink
Apply flake8-bugbear rule
Browse files Browse the repository at this point in the history
B904 Within an `except` clause, raise exceptions with
     `raise ... from err` or `raise ... from None` to
     distinguish them from errors in exception handling
  • Loading branch information
DimitriPapadopoulos committed Jan 5, 2024
1 parent aa42671 commit 8303023
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/installer/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def _get_launcher_data(self, kind: "LauncherKind") -> Optional[bytes]:
key = (self.section, kind)
try:
name = _ALLOWED_LAUNCHERS[key]
except KeyError:
except KeyError as exc:
error = f"{key!r} not in {sorted(_ALLOWED_LAUNCHERS)!r}"
raise InvalidScript(error)
raise InvalidScript(error) from exc
return read_binary(_scripts, name)

def _get_alternate_executable(self, executable: str, kind: "LauncherKind") -> str:
Expand Down

0 comments on commit 8303023

Please sign in to comment.