Skip to content

Commit 0535933

Browse files
committed
Remove unecessary replace
1 parent 46f551d commit 0535933

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

scripts/download_files.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,13 @@ def download_docstring_file(url: str) -> None:
3434
print(f"Downloading docstrings file from {repo} repository. "
3535
"Should we use the master branch or a PR branch?")
3636
branch = input("Enter 'master' or a PR number: ")
37-
if branch == "master":
38-
url = url.replace("master", branch)
39-
else:
37+
if branch != "master":
4038
pr_number = branch
4139
if not pr_number.isdigit():
4240
print("Invalid PR number.")
4341
return
4442
commit_hash = convert_pr_to_commit_hash(repo, pr_number)
45-
url = url.replace("master", commit_hash)
43+
url = url.replace("/master/", f"/{commit_hash}/")
4644
logging.info(f"Downloading docstrings file from {url}")
4745
response = requests.get(url)
4846
response.raise_for_status() # Raises 404 if the file is not found

0 commit comments

Comments
 (0)