Skip to content

Commit

Permalink
Merge pull request #2205 from HullSeals/enhancement/2199/better-excep…
Browse files Browse the repository at this point in the history
…tion-on-urlerr

[2199] Better Exceptions on URL Errors
  • Loading branch information
C1701D authored Apr 20, 2024
2 parents 8837b92 + 5cc08f2 commit 74fc774
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions killswitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions myNotebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -120,7 +120,7 @@ def paste(self) -> None:
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.
Expand Down

0 comments on commit 74fc774

Please sign in to comment.