diff options
Diffstat (limited to 'googleapiclient/model.py')
-rw-r--r-- | googleapiclient/model.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/googleapiclient/model.py b/googleapiclient/model.py index 554056e3e..f58549c49 100644 --- a/googleapiclient/model.py +++ b/googleapiclient/model.py @@ -27,12 +27,13 @@ __author__ = "jcgregorio@google.com (Joe Gregorio)" import json import logging import platform +import pkg_resources from six.moves.urllib.parse import urlencode -from googleapiclient import __version__ from googleapiclient.errors import HttpError +_LIBRARY_VERSION = pkg_resources.get_distribution("google-api-python-client").version _PY_VERSION = platform.python_version() LOGGER = logging.getLogger(__name__) @@ -152,7 +153,7 @@ class BaseModel(Model): else: headers["x-goog-api-client"] = "" headers["x-goog-api-client"] += "gdcl/%s gl-python/%s" % ( - __version__, + _LIBRARY_VERSION, _PY_VERSION, ) @@ -218,7 +219,7 @@ class BaseModel(Model): return self.no_content_response return self.deserialize(content) else: - LOGGER.debug("Content from bad request was: %s" % content) + LOGGER.debug("Content from bad request was: %r" % content) raise HttpError(resp, content) def serialize(self, body_value): |