From: W. Trevor King Date: Sun, 30 Dec 2012 17:54:24 +0000 (-0500) Subject: swc-installation-test-2.py: Don't parse missing versions X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=414b445ce974d63a2b09f2a058a916be0280d49e;p=swc-workshop.git swc-installation-test-2.py: Don't parse missing versions --- 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