From 414b445ce974d63a2b09f2a058a916be0280d49e Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 30 Dec 2012 12:54:24 -0500 Subject: [PATCH] swc-installation-test-2.py: Don't parse missing versions --- swc-installation-test-2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/swc-installation-test-2.py b/swc-installation-test-2.py index 857385c..69ef169 100755 --- a/swc-installation-test-2.py +++ b/swc-installation-test-2.py @@ -188,7 +188,7 @@ class Dependency (object): def _check_version(self, version, parsed_version=None): if not parsed_version: parsed_version = self._parse_version(version=version) - if parsed_version < self.minimum_version: + if not parsed_version or parsed_version < self.minimum_version: raise DependencyError( checker=self, message='outdated version of {0}: {1} (need >= {2})'.format( @@ -197,6 +197,8 @@ class Dependency (object): str(part) for part in self.minimum_version))) def _parse_version(self, version): + if not version: + return None parsed_version = [] for part in version.split(self.version_delimiter): try: @@ -328,7 +330,7 @@ class PythonPackageDependency (Dependency): try: version = package.__version__ except AttributeError: - version = 'unknown' + version = None return version -- 2.26.2