Skip to content

Commit

Permalink
Ignore exception raised by pip_system_certs not found (#3114)
Browse files Browse the repository at this point in the history
This dependency usually doesn't benefit Linux distros with requests library configured to use system certificate already. And is not packaged by most distros. Making it optional will make most Linux users' installation much easier.
  • Loading branch information
escape0707 committed Apr 5, 2024
1 parent 10d567f commit 97efd49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ laalsaas <laalsaas@systemli.org>
ijqq <ijqq@protonmail.ch>
AntoineQ1 <https://github.com/AntoineQ1>
jthulhu <https://github.com/jthulhu>
Escape0707 <tothesong@gmail.com>
********************

The text of the 3 clause BSD license follows:
Expand Down
7 changes: 6 additions & 1 deletion qt/aqt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
import logging
import sys

import pip_system_certs.wrapt_requests
try:
import pip_system_certs.wrapt_requests
except ModuleNotFoundError:
print(
"Python module pip_system_certs is not installed. System certificate store and custom SSL certificates may not work. See: https://github.com/ankitects/anki/issues/3016"
)

if sys.version_info[0] < 3 or sys.version_info[1] < 9:
raise Exception("Anki requires Python 3.9+")
Expand Down

0 comments on commit 97efd49

Please sign in to comment.