Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
Cleanup after merging python3 branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
craigcitro committed Nov 4, 2014
1 parent 669bad2 commit 0dacff1
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
v.next

Merge python3 branch! Massive thanks due to @pferate and @methane for doing
the heavy lifting.

Change `flow.step2_exchange` to preserve the raw `id_token` in the
`token_response` field.

Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
[![Build Status](https://travis-ci.org/google/oauth2client.svg?branch=master)](https://travis-ci.org/google/oauth2client)

NOTE
====

This is a work-in-progress branch to add python3 support to oauth2client. Most
of the work was done by @pferate.

This is a client library for accessing resources protected by OAuth 2.0.

[Full documentation](http://google.github.io/oauth2client/)
Expand Down
3 changes: 2 additions & 1 deletion oauth2client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def _do_refresh_request(self, http_request):
logger.info('Refreshing access_token')
resp, content = http_request(
self.token_uri, method='POST', body=body, headers=headers)
if six.PY3:
if six.PY3 and isinstance(content, bytes):
content = content.decode('utf-8')
if resp.status == 200:
d = json.loads(content)
Expand Down Expand Up @@ -953,6 +953,7 @@ class GoogleCredentials(OAuth2Credentials):
service that requires authentication:
<code>
from __future__ import print_function # unnecessary in python3
from googleapiclient.discovery import build
from oauth2client.client import GoogleCredentials
Expand Down
2 changes: 2 additions & 0 deletions oauth2client/locked_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
f.unlock_and_close()
"""

from __future__ import print_function

__author__ = 'cache@google.com (David T McWherter)'

import errno
Expand Down
1 change: 1 addition & 0 deletions oauth2client/old_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""This module holds the old run() function which is deprecated, the
tools.run_flow() function should be used in its place."""

from __future__ import print_function

import logging
import socket
Expand Down
1 change: 1 addition & 0 deletions oauth2client/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
__all__ = ['argparser', 'run_flow', 'run', 'message_if_missing']

from __future__ import print_function

import argparse
import BaseHTTPServer
Expand Down
2 changes: 1 addition & 1 deletion oauth2client/xsrfutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ def validate_token(key, token, user_id, action_id="", current_time=None):
different = 0
for x, y in zip(bytearray(token), bytearray(expected_token)):
different |= x ^ y
return different == 0
return not different
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'pyasn1==0.1.7',
'pyasn1_modules==0.0.5',
'rsa==3.1.4',
'six',
]

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

0 comments on commit 0dacff1

Please sign in to comment.