mirror of
https://github.com/vale981/melpazoid
synced 2025-03-06 01:41:38 -05:00
remove contextlib.suppress; these exceptions are being handled
This commit is contained in:
parent
bf3cd52de9
commit
ae5d31062d
1 changed files with 6 additions and 5 deletions
|
@ -14,7 +14,6 @@ __author__ = 'Chris Rayner <dchrisrayner@gmail.com>'
|
|||
__license__ = 'SPDX-License-Identifier: GPL-3.0-or-later'
|
||||
import argparse
|
||||
import configparser
|
||||
import contextlib
|
||||
import functools
|
||||
import glob
|
||||
import json
|
||||
|
@ -522,10 +521,11 @@ def check_package_name(name: str) -> None:
|
|||
for name_, url in known_names.items()
|
||||
if any(name_.startswith(keyword) for keyword in keywords)
|
||||
][:10]
|
||||
name_builtin = False
|
||||
with contextlib.suppress(ChildProcessError):
|
||||
try:
|
||||
run_build_script(f"(require '{name})")
|
||||
name_builtin = True
|
||||
except ChildProcessError:
|
||||
name_builtin = False
|
||||
name_reserved = any(re.match(reserved, name) for reserved in _RESERVED_REGEXPS)
|
||||
if not similar_names and not name_builtin and not name_reserved:
|
||||
return
|
||||
|
@ -915,9 +915,10 @@ def _url_get(url: str) -> str:
|
|||
|
||||
|
||||
def _url_ok(url: str) -> bool:
|
||||
with contextlib.suppress(urllib.error.URLError):
|
||||
try:
|
||||
with urllib.request.urlopen(urllib.request.Request(url, method='HEAD')):
|
||||
return True
|
||||
except urllib.error.URLError:
|
||||
return False
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue