Skip to content

Commit

Permalink
update.py: correct fetch-parameter-file logic
Browse files Browse the repository at this point in the history
too much whitespace on the rename line means if the file doesn't already exist we don't replace it
  • Loading branch information
peterbarker authored and Hwurzburg committed Nov 13, 2023
1 parent e4cf583 commit 3ac9580
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,8 @@ def remove_if_exists(filepath):

def fetch_and_rename(fetchurl: str, target_file: str, new_name: str) -> None:
fetch_url(fetchurl, fpath=new_name, verbose=False)
# move in new file
if os.path.exists(target_file):
os.unlink(target_file)
os.rename(new_name, target_file)
print(f"Renaming {new_name} to {target_file}")
os.replace(new_name, target_file)


def fetch_url(fetchurl: str, fpath: Optional[str] = None, verbose: bool = True) -> None:
Expand Down

0 comments on commit 3ac9580

Please sign in to comment.