Allow different whitespace.

This commit is contained in:
Jelmer Vernooij 2021-03-24 03:35:19 +00:00
parent 4d84971dc4
commit 1c859b2fd3

View file

@ -281,7 +281,7 @@ class RPackageRequirement(Requirement):
@classmethod @classmethod
def from_str(cls, text): def from_str(cls, text):
# TODO(jelmer): More complex parser # TODO(jelmer): More complex parser
m = re.fullmatch(r'(.*)\s+\(>= (.*)\)', text) m = re.fullmatch(r'(.*)\s+\(>=\s+(.*)\)', text)
if m: if m:
return cls(m.group(1), m.group(2)) return cls(m.group(1), m.group(2))
m = re.fullmatch(r'([^ ]+)', text) m = re.fullmatch(r'([^ ]+)', text)
@ -316,7 +316,7 @@ class OctavePackageRequirement(Requirement):
@classmethod @classmethod
def from_str(cls, text): def from_str(cls, text):
# TODO(jelmer): More complex parser # TODO(jelmer): More complex parser
m = re.fullmatch(r'(.*)\s+\(>= (.*)\)', text) m = re.fullmatch(r'(.*)\s+\(>=\s+(.*)\)', text)
if m: if m:
return cls(m.group(1), m.group(2)) return cls(m.group(1), m.group(2))
m = re.fullmatch(r'([^ ]+)', text) m = re.fullmatch(r'([^ ]+)', text)