summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authortoofar <toofar@spalge.com>2023-02-06 18:53:56 +1300
committertoofar <toofar@spalge.com>2023-02-06 18:53:56 +1300
commitff8dbc45805013b5a119a0d6b2c943308faeca8e (patch)
treec3c3d2337d797267b2c248dbbfae85c24adfbb1c /scripts
parent7dacc89d2ad4cf31010f69e2a40847d7a2b34fc4 (diff)
downloadqutebrowser-ff8dbc45805013b5a119a0d6b2c943308faeca8e.tar.gz
qutebrowser-ff8dbc45805013b5a119a0d6b2c943308faeca8e.zip
lint: broad-exception-raised
Mostly pretty lazy fixes. Most of the places in the tests we were already matching on error message, a couple of places we weren't. The tick-tock one was the only one that wasn't being used right where it was raised. Some of them I just changed to RuntimeError because it was shorter than adding the pylint directive.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dev/build_release.py5
-rwxr-xr-xscripts/dev/src2asciidoc.py1
-rwxr-xr-xscripts/dev/update_3rdparty.py2
3 files changed, 6 insertions, 2 deletions
diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py
index 39c730472..18658f920 100755
--- a/scripts/dev/build_release.py
+++ b/scripts/dev/build_release.py
@@ -223,7 +223,7 @@ def smoke_test(executable: pathlib.Path, debug: bool) -> None:
"",
]
- raise Exception("\n".join(lines))
+ raise Exception("\n".join(lines)) # pylint: disable=broad-exception-raised
def verify_windows_exe(exe_path: pathlib.Path) -> None:
@@ -598,7 +598,7 @@ def read_github_token(
if optional:
return None
else:
- raise Exception(
+ raise Exception( # pylint: disable=broad-exception-raised
"GitHub token needed, but ~/.gh_token not found, "
"and --gh-token not given.")
@@ -614,6 +614,7 @@ def github_upload(artifacts: List[Artifact], tag: str, gh_token: str) -> None:
tag: The name of the release tag
gh_token: The GitHub token to use
"""
+ # pylint: disable=broad-exception-raised
import github3
import github3.exceptions
utils.print_title("Uploading to github...")
diff --git a/scripts/dev/src2asciidoc.py b/scripts/dev/src2asciidoc.py
index 1267a278a..732b01f26 100755
--- a/scripts/dev/src2asciidoc.py
+++ b/scripts/dev/src2asciidoc.py
@@ -499,6 +499,7 @@ def _format_block(filename, what, data):
what: What to change (authors, options, etc.)
data; A list of strings which is the new data.
"""
+ # pylint: disable=broad-exception-raised
what = what.upper()
oshandle, tmpname = tempfile.mkstemp()
try:
diff --git a/scripts/dev/update_3rdparty.py b/scripts/dev/update_3rdparty.py
index b1991fa1f..71d7ae7b5 100755
--- a/scripts/dev/update_3rdparty.py
+++ b/scripts/dev/update_3rdparty.py
@@ -66,6 +66,7 @@ def download_nsis_plugins():
def find_pdfjs_asset(assets, legacy):
"""Find the PDF.js asset to use."""
+ # pylint: disable=broad-exception-raised
for asset in assets:
name = asset["name"]
if (
@@ -82,6 +83,7 @@ def get_latest_pdfjs_url(gh_token, legacy):
Returns a (version, url)-tuple.
"""
+ # pylint: disable=broad-exception-raised
github_api = 'https://api.github.com'
endpoint = 'repos/mozilla/pdf.js/releases/latest'
request = urllib.request.Request(f'{github_api}/{endpoint}')