summaryrefslogtreecommitdiff
path: root/semantic_version
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2019-09-06 13:06:57 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2019-09-06 13:06:57 +0200
commitf029601524ab56205990aa0a69621a89de04c43a (patch)
tree18fe8c4244440ef8ce1c8a693a4aae4eb65415a6 /semantic_version
parent17949b82ac9a1173566c08bab4b254e9d64a7ce1 (diff)
downloadsemantic-version-f029601524ab56205990aa0a69621a89de04c43a.tar.gz
Fix Spec.specs for single-term ranges.maint/2.x
This (deprecated) property failed when used on a `Spec` item based on a single-term range (e.g. `==0.1.2` `<2.0.0`). Closes #82.
Diffstat (limited to 'semantic_version')
-rw-r--r--semantic_version/base.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/semantic_version/base.py b/semantic_version/base.py
index dc5e21e..078d83d 100644
--- a/semantic_version/base.py
+++ b/semantic_version/base.py
@@ -1166,7 +1166,11 @@ class LegacySpec(SimpleSpec):
DeprecationWarning,
stacklevel=2,
)
- for clause in self.clause:
+ try:
+ clauses = list(self.clause)
+ except TypeError: # Not an iterable
+ clauses = [self.clause]
+ for clause in clauses:
yield SpecItem.from_matcher(clause)