1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-12 15:27:14 +03:00

Merge pull request #2205 from HullSeals/enhancement/2199/better-exception-on-urlerr

[2199] Better Exceptions on URL Errors
This commit is contained in:
Phoebe 2024-04-20 23:28:15 +02:00 committed by GitHub
commit 74fc774704
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -361,8 +361,8 @@ def fetch_kill_switches(target=DEFAULT_KILLSWITCH_URL) -> KillSwitchJSONFile | N
logger.warning(f"Failed to get kill switches, data was invalid: {e}")
return None
except (requests.exceptions.BaseHTTPError, requests.exceptions.ConnectionError) as e: # type: ignore
logger.warning(f"unable to connect to {target!r}: {e}")
except requests.exceptions.RequestException as requ_err:
logger.warning(f"unable to connect to {target!r}: {requ_err}")
return None
return data

View File

@ -67,7 +67,7 @@ class EntryMenu(ttk.Entry):
"""Extended entry widget that includes a context menu with Copy, Cut-and-Paste commands."""
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
ttk.Entry.__init__(self, *args, **kwargs)
self.menu = tk.Menu(self, tearoff=False)
self.menu.add_command(label="Copy", command=self.copy)
@ -120,7 +120,7 @@ class EntryMenu(ttk.Entry):
pass
class Entry(ttk.Entry or EntryMenu): # type: ignore
class Entry(EntryMenu):
"""Custom t(t)k.Entry class to fix some display issues."""
# DEPRECATED: Migrate to ttk.Entry or EntryMenu. Will remove in 5.12 or later.