Fix regex (#16850)
This commit is contained in:
parent
3740ba9226
commit
ea213f687a
@ -67,7 +67,7 @@ def read_requirements(path: str) -> List[str]:
|
||||
# get rid of newlines
|
||||
line = line.replace('\n', '')
|
||||
# if version is specified (non-word chars present)
|
||||
if re.search('\W', line):
|
||||
if re.search('(~|=|<|>|;)', line):
|
||||
requirements.append(line)
|
||||
# else get version from constraints
|
||||
else:
|
||||
|
@ -72,7 +72,7 @@ def read_requirements(path: str) -> List[str]:
|
||||
# get rid of newlines
|
||||
line = line.replace('\n', '')
|
||||
# if version is specified (non-word chars present)
|
||||
if re.search('\W', line):
|
||||
if re.search('(~|=|<|>|;)', line):
|
||||
requirements.append(line)
|
||||
# else get version from constraints
|
||||
else:
|
||||
|
@ -252,7 +252,7 @@ def read_requirements(path: str) -> List[str]:
|
||||
# get rid of newlines
|
||||
line = line.replace('\n', '')
|
||||
# if version is specified (non-word chars present)
|
||||
if re.search('\W', line):
|
||||
if re.search('(~|=|<|>|;)', line):
|
||||
requirements.append(line)
|
||||
# else get version from constraints
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user