@@ -78,25 +78,17 @@ def __init__(self, spec=None):
7878 if "," in _spec :
7979 lower_bound , upper_bound = _spec .split ("," )
8080 if lower_bound and lower_bound == upper_bound :
81- raise RestrictionParseError (
82- "Range cannot have identical boundaries: %s" % spec
83- )
81+ raise RestrictionParseError ("Range cannot have identical boundaries: %s" % spec )
8482
8583 self .lower_bound = Version (lower_bound ) if lower_bound else None
8684 self .upper_bound = Version (upper_bound ) if upper_bound else None
8785
88- if (
89- self .lower_bound
90- and self .upper_bound
91- and self .upper_bound < self .lower_bound
92- ):
86+ if self .lower_bound and self .upper_bound and self .upper_bound < self .lower_bound :
9387 raise RestrictionParseError ("Range defies version ordering: %s" % spec )
9488 else :
9589 # single version restriction
9690 if not self .lower_bound_inclusive or not self .upper_bound_inclusive :
97- raise RestrictionParseError (
98- "Single version must be surrounded by []: %s" % spec
99- )
91+ raise RestrictionParseError ("Single version must be surrounded by []: %s" % spec )
10092 version = Version (_spec )
10193 self .lower_bound = version
10294 self .upper_bound = version
@@ -139,9 +131,7 @@ def __cmp__(self, other):
139131 if result == 0 :
140132 result = cmp (self .upper_bound , other .upper_bound )
141133 if result == 0 :
142- result = cmp (
143- self .upper_bound_inclusive , other .upper_bound_inclusive
144- )
134+ result = cmp (self .upper_bound_inclusive , other .upper_bound_inclusive )
145135 return result
146136
147137 def __eq__ (self , other ):
@@ -232,10 +222,7 @@ def __init__(self, spec):
232222 lower_bound = restriction .lower_bound
233223
234224 if upper_bound is not None :
235- if (
236- restriction .lower_bound is None
237- or restriction .lower_bound < upper_bound
238- ):
225+ if restriction .lower_bound is None or restriction .lower_bound < upper_bound :
239226 raise VersionRangeParseError ("Ranges overlap: %s" % spec )
240227 restrictions .append (restriction )
241228 upper_bound = restriction .upper_bound
@@ -248,8 +235,7 @@ def __init__(self, spec):
248235 if _spec :
249236 if restrictions :
250237 raise VersionRangeParseError (
251- "Only fully-qualified sets allowed in multiple set"
252- " scenario: %s" % spec
238+ "Only fully-qualified sets allowed in multiple set" " scenario: %s" % spec
253239 )
254240 else :
255241 version = Version (_spec )
0 commit comments