summaryrefslogtreecommitdiff
path: root/docker/client.py
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2014-11-26 23:14:19 +0100
committerJoffrey F <joffrey@docker.com>2014-11-26 23:14:19 +0100
commita9bc84cece547d101069afd195d1500f67e3a44a (patch)
tree138523304d30a029705dcf01ef58cb0362b88c4e /docker/client.py
parent0012430b1bda8a7e16c58366624a733ba63712a8 (diff)
downloaddocker-py-393-enforce-str-version.tar.gz
Enforce passing string as version param in ctor393-enforce-str-version
Diffstat (limited to 'docker/client.py')
-rw-r--r--docker/client.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/docker/client.py b/docker/client.py
index de3bce6..06fa145 100644
--- a/docker/client.py
+++ b/docker/client.py
@@ -50,6 +50,12 @@ class Client(requests.Session):
raise errors.TLSParameterError(
'If using TLS, the base_url argument must begin with '
'"https://".')
+ if not isinstance(version, six.string_types):
+ raise errors.DockerException(
+ 'version parameter must be a string. Found {0}'.format(
+ type(version).__name__
+ )
+ )
self.base_url = base_url
self._version = version
self._timeout = timeout