From dd93ba831035a28a896c5d948d0968e8feb9910a Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Tue, 7 Jan 2020 00:13:35 +0000 Subject: [PATCH] make cffi backend import defensive --- my/location/takeout.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/my/location/takeout.py b/my/location/takeout.py index 5a61486..77c94a3 100644 --- a/my/location/takeout.py +++ b/my/location/takeout.py @@ -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