mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
check python version and locale on load
This commit is contained in:
parent
e38125d9aa
commit
786600ebb6
2 changed files with 9 additions and 4 deletions
|
@ -37,5 +37,13 @@ Save & close:
|
||||||
deck.close()
|
deck.close()
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
if sys.version_info[0] > 2:
|
||||||
|
raise Exception("Anki should be run with python2.x.")
|
||||||
|
elif sys.version_info[1] < 5:
|
||||||
|
raise Exception("Anki requires Python 2.5+")
|
||||||
|
if sys.getfilesystemencoding().lower() in ("ascii", "ansi_x3.4-1968"):
|
||||||
|
raise Exception("Anki requires a UTF-8 locale.")
|
||||||
|
|
||||||
version = "1.99"
|
version = "1.99"
|
||||||
from anki.storage import Deck
|
from anki.storage import Deck
|
||||||
|
|
|
@ -6,10 +6,7 @@ import os
|
||||||
try:
|
try:
|
||||||
from pysqlite2 import dbapi2 as sqlite
|
from pysqlite2 import dbapi2 as sqlite
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
from sqlite3 import dbapi2 as sqlite
|
||||||
from sqlite3 import dbapi2 as sqlite
|
|
||||||
except:
|
|
||||||
raise Exception("Please install pysqlite2 or python2.5")
|
|
||||||
|
|
||||||
from anki.hooks import runHook
|
from anki.hooks import runHook
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue