Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2199] Better Exceptions on URL Errors #2205

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading