mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Gracefully handle pypi pysol_cards dependency
See: https://sourceforge.net/p/pysolfc/discussion/503708/thread/208461caee/ Thanks to Fred.
This commit is contained in:
parent
e2c11a7ba0
commit
b24da7cc92
1 changed files with 9 additions and 1 deletions
|
@ -25,7 +25,15 @@
|
||||||
# imports
|
# imports
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import pysol_cards
|
try:
|
||||||
|
import pysol_cards
|
||||||
|
except ImportError:
|
||||||
|
import sys
|
||||||
|
sys.stderr.write(
|
||||||
|
"Please install pysol_cards.py from \"PyPI\"\r\n" +
|
||||||
|
"(e.g: using \"python3 -m pip install " +
|
||||||
|
"--user --upgrade pysol_cards\"\r\n")
|
||||||
|
sys.exit(1)
|
||||||
assert getattr(pysol_cards, 'VERSION', (0, 0, 0)) >= (0, 8, 17), (
|
assert getattr(pysol_cards, 'VERSION', (0, 0, 0)) >= (0, 8, 17), (
|
||||||
"Newer version of https://pypi.org/project/pysol-cards is required.")
|
"Newer version of https://pypi.org/project/pysol-cards is required.")
|
||||||
import pysol_cards.random # noqa: E402,I100
|
import pysol_cards.random # noqa: E402,I100
|
||||||
|
|
Loading…
Add table
Reference in a new issue