Skip to content

Commit

Permalink
NpmSpec parsing to allow spaces between simple clauses.
Browse files Browse the repository at this point in the history
  • Loading branch information
gnattishness committed Jul 10, 2021
1 parent af300d3 commit ddfa7e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions semantic_version/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,10 +1256,10 @@ def parse(cls, expression):
subclauses = []
if cls.HYPHEN in group:
low, high = group.split(cls.HYPHEN, 2)
subclauses = cls.parse_simple('>=' + low) + cls.parse_simple('<=' + high)
subclauses = cls.parse_simple('>=' + low.strip()) + cls.parse_simple('<=' + high.strip())

else:
blocks = group.split(' ')
blocks = group.split()
for block in blocks:
if not cls.NPM_SPEC_BLOCK.match(block):
raise ValueError("Invalid NPM block in %r: %r" % (expression, block))
Expand Down

0 comments on commit ddfa7e9

Please sign in to comment.