We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46f551d commit 0535933Copy full SHA for 0535933
1 file changed
scripts/download_files.py
@@ -34,15 +34,13 @@ def download_docstring_file(url: str) -> None:
34
print(f"Downloading docstrings file from {repo} repository. "
35
"Should we use the master branch or a PR branch?")
36
branch = input("Enter 'master' or a PR number: ")
37
- if branch == "master":
38
- url = url.replace("master", branch)
39
- else:
+ if branch != "master":
40
pr_number = branch
41
if not pr_number.isdigit():
42
print("Invalid PR number.")
43
return
44
commit_hash = convert_pr_to_commit_hash(repo, pr_number)
45
- url = url.replace("master", commit_hash)
+ url = url.replace("/master/", f"/{commit_hash}/")
46
logging.info(f"Downloading docstrings file from {url}")
47
response = requests.get(url)
48
response.raise_for_status() # Raises 404 if the file is not found
0 commit comments