Skip to content

Commit 0dacff1

Browse files
committed
Cleanup after merging python3 branch.
1 parent 669bad2 commit 0dacff1

File tree

8 files changed

+11
-8
lines changed

8 files changed

+11
-8
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
v.next
22

3+
Merge python3 branch! Massive thanks due to @pferate and @methane for doing
4+
the heavy lifting.
5+
36
Change `flow.step2_exchange` to preserve the raw `id_token` in the
47
`token_response` field.
58

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
[![Build Status](https://travis-ci.org/google/oauth2client.svg?branch=master)](https://travis-ci.org/google/oauth2client)
22

3-
NOTE
4-
====
5-
6-
This is a work-in-progress branch to add python3 support to oauth2client. Most
7-
of the work was done by @pferate.
8-
93
This is a client library for accessing resources protected by OAuth 2.0.
104

115
[Full documentation](http://google.github.io/oauth2client/)

oauth2client/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ def _do_refresh_request(self, http_request):
762762
logger.info('Refreshing access_token')
763763
resp, content = http_request(
764764
self.token_uri, method='POST', body=body, headers=headers)
765-
if six.PY3:
765+
if six.PY3 and isinstance(content, bytes):
766766
content = content.decode('utf-8')
767767
if resp.status == 200:
768768
d = json.loads(content)
@@ -953,6 +953,7 @@ class GoogleCredentials(OAuth2Credentials):
953953
service that requires authentication:
954954
955955
<code>
956+
from __future__ import print_function # unnecessary in python3
956957
from googleapiclient.discovery import build
957958
from oauth2client.client import GoogleCredentials
958959

oauth2client/locked_file.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
f.unlock_and_close()
2929
"""
3030

31+
from __future__ import print_function
32+
3133
__author__ = '[email protected] (David T McWherter)'
3234

3335
import errno

oauth2client/old_run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"""This module holds the old run() function which is deprecated, the
1616
tools.run_flow() function should be used in its place."""
1717

18+
from __future__ import print_function
1819

1920
import logging
2021
import socket

oauth2client/tools.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
__author__ = '[email protected] (Joe Gregorio)'
2323
__all__ = ['argparser', 'run_flow', 'run', 'message_if_missing']
2424

25+
from __future__ import print_function
2526

2627
import argparse
2728
import BaseHTTPServer

oauth2client/xsrfutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ def validate_token(key, token, user_id, action_id="", current_time=None):
115115
different = 0
116116
for x, y in zip(bytearray(token), bytearray(expected_token)):
117117
different |= x ^ y
118-
return different == 0
118+
return not different

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
'pyasn1==0.1.7',
3737
'pyasn1_modules==0.0.5',
3838
'rsa==3.1.4',
39+
'six',
3940
]
4041

4142
long_desc = """The oauth2client is a client library for OAuth 2.0."""

0 commit comments

Comments
 (0)