mirror of
https://github.com/open-quantum-safe/liboqs.git
synced 2025-10-04 00:02:01 -04:00
Use split with no argument to split against any whitespace, not just space
Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>
This commit is contained in:
parent
40cc1a508a
commit
b25cdb3298
@ -29,7 +29,8 @@ def format_upstream_source(source: str) -> str:
|
|||||||
if not prefix in source:
|
if not prefix in source:
|
||||||
raise ValueError(f"Non-GitHub source {source}")
|
raise ValueError(f"Non-GitHub source {source}")
|
||||||
url_start = source.find(prefix)
|
url_start = source.find(prefix)
|
||||||
url = source[url_start:].split(" ")[0]
|
# NOTE: split with no argument will split with all whitespaces
|
||||||
|
url = source[url_start:].split()[0]
|
||||||
# example: ["PQClean", "PQClean", "commit", "1eacfdaf..."]
|
# example: ["PQClean", "PQClean", "commit", "1eacfdaf..."]
|
||||||
tokens = url[len(prefix) :].split("/")
|
tokens = url[len(prefix) :].split("/")
|
||||||
handle, repo = tokens[0], tokens[1]
|
handle, repo = tokens[0], tokens[1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user