From: Harmon Date: Wed, 29 Sep 2021 15:02:07 +0000 (-0500) Subject: Handle simplejson being installed when handling JSONDecodeError X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=586c1621f71c9569c17b6bdbee99a7c238bb301d;p=tweepy.git Handle simplejson being installed when handling JSONDecodeError --- diff --git a/tweepy/errors.py b/tweepy/errors.py index e258c6a..fad1cbf 100644 --- a/tweepy/errors.py +++ b/tweepy/errors.py @@ -2,7 +2,12 @@ # Copyright 2009-2021 Joshua Roesslein # See LICENSE for details. -import json +try: + # Handle https://github.com/psf/requests/issues/5794 until requests 2.27.0 + # is released with https://github.com/psf/requests/pull/5856 + import simplejson as json +except ImportError: + import json class TweepyException(Exception):