mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
fix up ankiweb.certs paths
also fixes https://anki.tenderapp.com/discussions/ankidesktop/18420-portable-anki-sync-error
This commit is contained in:
parent
39a2ddac51
commit
05d13de766
1 changed files with 8 additions and 9 deletions
17
anki/sync.py
17
anki/sync.py
|
@ -39,16 +39,15 @@ except AttributeError:
|
||||||
def httpCon():
|
def httpCon():
|
||||||
certs = os.path.join(os.path.dirname(__file__), "ankiweb.certs")
|
certs = os.path.join(os.path.dirname(__file__), "ankiweb.certs")
|
||||||
if not os.path.exists(certs):
|
if not os.path.exists(certs):
|
||||||
if isWin:
|
if not isMac:
|
||||||
certs = os.path.join(
|
certs = os.path.abspath(os.path.join(
|
||||||
os.path.dirname(os.path.abspath(sys.argv[0])),
|
os.path.dirname(certs), "..", "ankiweb.certs"))
|
||||||
"ankiweb.certs")
|
|
||||||
elif isMac:
|
|
||||||
certs = os.path.join(
|
|
||||||
os.path.dirname(os.path.abspath(sys.argv[0])),
|
|
||||||
"../Resources/ankiweb.certs")
|
|
||||||
else:
|
else:
|
||||||
assert 0, "Your distro has not packaged Anki correctly."
|
certs = os.path.abspath(os.path.join(
|
||||||
|
os.path.dirname(os.path.abspath(sys.argv[0])),
|
||||||
|
"../Resources/ankiweb.certs"))
|
||||||
|
if not os.path.exists(certs):
|
||||||
|
assert 0, "Unable to locate ankiweb.certs"
|
||||||
return httplib2.Http(
|
return httplib2.Http(
|
||||||
timeout=HTTP_TIMEOUT, ca_certs=certs,
|
timeout=HTTP_TIMEOUT, ca_certs=certs,
|
||||||
proxy_info=HTTP_PROXY,
|
proxy_info=HTTP_PROXY,
|
||||||
|
|
Loading…
Reference in a new issue