From 586c1621f71c9569c17b6bdbee99a7c238bb301d Mon Sep 17 00:00:00 2001 From: Harmon Date: Wed, 29 Sep 2021 10:02:07 -0500 Subject: [PATCH] Handle simplejson being installed when handling JSONDecodeError --- tweepy/errors.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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): -- 2.25.1