From b7e92b3e52431df7a59dfcddc414486bc8c6a6c5 Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Wed, 15 Jul 2015 21:05:13 -0400 Subject: [PATCH] docker: fix parsing of docker __version__ string If `docker.__version__` contains non-digit characters, such as: >>> import docker >>> docker.__version__ '1.4.0-dev' Then `get_docker_py_versioninfo` will fail with: ValueError: invalid literal for int() with base 10: '0-de' This patch corrects the parsing of the version string so that `get_docker_py_versioninfo` in this example would return: (1, 4, 0, '-dev') --- cloud/docker/docker.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cloud/docker/docker.py b/cloud/docker/docker.py index 2bbbbd158a2..c9f967757ef 100644 --- a/cloud/docker/docker.py +++ b/cloud/docker/docker.py @@ -481,6 +481,7 @@ def get_docker_py_versioninfo(): if not char.isdigit(): nondigit = part[idx:] digit = part[:idx] + break if digit: version.append(int(digit)) if nondigit: