aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/requests-oauthlib/requests_oauthlib/compliance_fixes/mailchimp.py
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-03-25 09:11:17 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-03-25 09:17:48 +0300
commit4624e4cfd95649270db02616edde8d0ca249b63d (patch)
tree1c8a43f50533ca759d137f258e42862e8cf5e80f /contrib/python/requests-oauthlib/requests_oauthlib/compliance_fixes/mailchimp.py
parentd2d971701bd8377ead5f973c96be81042774bd2a (diff)
downloadydb-4624e4cfd95649270db02616edde8d0ca249b63d.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python/requests-oauthlib/requests_oauthlib/compliance_fixes/mailchimp.py')
-rw-r--r--contrib/python/requests-oauthlib/requests_oauthlib/compliance_fixes/mailchimp.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/contrib/python/requests-oauthlib/requests_oauthlib/compliance_fixes/mailchimp.py b/contrib/python/requests-oauthlib/requests_oauthlib/compliance_fixes/mailchimp.py
index c69ce9fdae..0d602659c6 100644
--- a/contrib/python/requests-oauthlib/requests_oauthlib/compliance_fixes/mailchimp.py
+++ b/contrib/python/requests-oauthlib/requests_oauthlib/compliance_fixes/mailchimp.py
@@ -1,21 +1,19 @@
import json
-from oauthlib.common import to_unicode
-
def mailchimp_compliance_fix(session):
def _null_scope(r):
token = json.loads(r.text)
if "scope" in token and token["scope"] is None:
token.pop("scope")
- r._content = to_unicode(json.dumps(token)).encode("utf-8")
+ r._content = json.dumps(token).encode()
return r
def _non_zero_expiration(r):
token = json.loads(r.text)
if "expires_in" in token and token["expires_in"] == 0:
token["expires_in"] = 3600
- r._content = to_unicode(json.dumps(token)).encode("utf-8")
+ r._content = json.dumps(token).encode()
return r
session.register_compliance_hook("access_token_response", _null_scope)