mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Detect Debian-related problems and abort.
This commit is contained in:
parent
cdc026ed3d
commit
ae4049ea97
1 changed files with 28 additions and 1 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
vdirsyncer is a synchronization tool for vdir. See the README for more details.
|
vdirsyncer is a synchronization tool for vdir. See the README for more details.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .version import version as __version__ # noqa
|
from .version import version as __version__ # noqa
|
||||||
|
|
@ -13,5 +14,31 @@ except ImportError:
|
||||||
'use the PyPI ones.'
|
'use the PyPI ones.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _detect_faulty_requests():
|
||||||
|
import requests
|
||||||
|
if 'dist-packages' not in requests.__file__:
|
||||||
|
return
|
||||||
|
|
||||||
|
text = (
|
||||||
|
'{e}\n\n'
|
||||||
|
'This most likely means you are running into a bug specific to '
|
||||||
|
'Debian-based distributions.\n\n'
|
||||||
|
'Consult {d}/problems.html#requests-related-importerrors-on-debian'
|
||||||
|
'-based-distributions on how to deal with this, or use a different '
|
||||||
|
'operating system.'
|
||||||
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
from requests_toolbelt.auth.guess import GuessAuth # noqa
|
||||||
|
except ImportError as e:
|
||||||
|
import sys
|
||||||
|
print(text.format(e=str(e), d=DOCS_HOME), file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
_detect_faulty_requests()
|
||||||
|
|
||||||
|
|
||||||
PROJECT_HOME = 'https://github.com/untitaker/vdirsyncer'
|
PROJECT_HOME = 'https://github.com/untitaker/vdirsyncer'
|
||||||
DOCS_HOME = 'https://vdirsyncer.readthedocs.org/en/latest'
|
DOCS_HOME = 'https://vdirsyncer.readthedocs.org/en/stable'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue