make cffi backend import defensive
This commit is contained in:
parent
aa1e004a21
commit
dd93ba8310
1 changed files with 9 additions and 5 deletions
|
@ -12,12 +12,16 @@ import pytz
|
|||
# pip3 install geopy
|
||||
import geopy # type: ignore
|
||||
import geopy.distance # type: ignore
|
||||
# pip3 install ijson cffi
|
||||
# cffi backend is almost 2x faster than default
|
||||
import ijson.backends.yajl2_cffi as ijson # type: ignore
|
||||
|
||||
from cachew import cachew, mtime_hash
|
||||
from kython import kompress # TODO
|
||||
try:
|
||||
# pip3 install ijson cffi
|
||||
# cffi backend is almost 2x faster than default
|
||||
import ijson.backends.yajl2_cffi as ijson # type: ignore
|
||||
except:
|
||||
# fallback to default backend. warning?
|
||||
import ijson
|
||||
|
||||
from kython import kompress # TODO
|
||||
|
||||
from ..common import get_files
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue