diff --git a/src/googleapiclient/__init__.py b/src/googleapiclient/__init__.py index 97977bb7..184219af 100644 --- a/src/googleapiclient/__init__.py +++ b/src/googleapiclient/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.6.3" +__version__ = "1.6.4" # Set default logging handler to avoid "No handler found" warnings. import logging diff --git a/src/googleapiclient/_auth.py b/src/googleapiclient/_auth.py index 92f2796f..ada4ffb1 100644 --- a/src/googleapiclient/_auth.py +++ b/src/googleapiclient/_auth.py @@ -19,11 +19,15 @@ import httplib2 try: import google.auth import google.auth.credentials - import google_auth_httplib2 HAS_GOOGLE_AUTH = True except ImportError: # pragma: NO COVER HAS_GOOGLE_AUTH = False +try: + import google_auth_httplib2 +except ImportError: # pragma: NO COVER + google_auth_httplib2 = None + try: import oauth2client import oauth2client.client @@ -88,6 +92,12 @@ def authorized_http(credentials): if HAS_GOOGLE_AUTH and isinstance( credentials, google.auth.credentials.Credentials): + if google_auth_httplib2 is None: + raise ValueError( + 'Credentials from google.auth specified, but ' + 'google-api-python-client is unable to use these credentials ' + 'unless google-auth-httplib2 is installed. Please install ' + 'google-auth-httplib2.') return google_auth_httplib2.AuthorizedHttp(credentials, http=build_http()) else: