Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions gcloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

"""GCloud API access in idiomatic Python."""

from pkg_resources import get_distribution

__version__ = get_distribution('gcloud').version
try:
import pkg_resources
__version__ = pkg_resources.get_distribution('gcloud').version
except (ImportError, pkg_resources.DistributionNotFound): # pragma: NO COVER
__version__ = None
6 changes: 3 additions & 3 deletions gcloud/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

""" Shared implementation of connections to API servers."""

from pkg_resources import get_distribution

import httplib2

import gcloud


class Connection(object):
"""A generic connection to Google Cloud Platform.
Expand All @@ -32,7 +32,7 @@ class Connection(object):
_EMPTY = object()
"""A pointer to represent an empty value for default arguments."""

USER_AGENT = "gcloud-python/{0}".format(get_distribution('gcloud').version)
USER_AGENT = "gcloud-python/{0}".format(gcloud.__version__)
"""The user agent for gcloud-python requests."""

def __init__(self, credentials=None):
Expand Down