Skip to content

Commit

Permalink
fix: Python <3.9 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mrossinek committed Feb 21, 2022
1 parent 5abfbe4 commit 5766690
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def convert(self, replace: bool = False) -> None:

new_hdf5_file = hdf5_file
if not replace:
new_hdf5_file = hdf5_file.with_stem(str(hdf5_file.stem) + "_new")
new_hdf5_file = hdf5_file.with_name(str(hdf5_file.stem) + "_new.hdf5")

driver_result = ElectronicStructureDriverResult.from_legacy_driver_result(q_mol)
save_to_hdf5(driver_result, str(new_hdf5_file), replace=replace)
Expand Down
4 changes: 2 additions & 2 deletions test/drivers/second_quantization/hdf5d/test_driver_hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def test_convert(self):
# pylint: disable=consider-using-with
tmp_file = tempfile.NamedTemporaryFile(delete=False, suffix=".hdf5")
tmp_file.close()
new_file_name = pathlib.Path(tmp_file.name).with_stem(
str(pathlib.Path(tmp_file.name).stem) + "_new"
new_file_name = pathlib.Path(tmp_file.name).with_name(
str(pathlib.Path(tmp_file.name).stem) + "_new.hdf5"
)
os.unlink(tmp_file.name)
shutil.copy(legacy_file_path, tmp_file.name)
Expand Down

0 comments on commit 5766690

Please sign in to comment.