Skip to content

Commit

Permalink
Python 3.7 and 3.8 compatibility
Browse files Browse the repository at this point in the history
I was inadvertently using a method that is only in pathlib for 3.9+, switch to a call that is compatible with older versions.
  • Loading branch information
Corey Ostrove committed Sep 6, 2023
1 parent d63d427 commit 285c5b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pygsti/protocols/gst.py
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,10 @@ def run(self, data, memlimit=None, comm=None, checkpoint= None, checkpoint_path=
for i, mode in enumerate(modes):
printer.show_progress(i, len(modes), prefix='-- Std Practice: ', suffix=' (%s) --' % mode)
if not disable_checkpointing:
checkpoint_path = checkpoint_path_base.with_stem(f"{checkpoint_path_base.stem}_{mode.replace(' ', '_')}")
#pre python 3.9 compatible version.
checkpoint_path = checkpoint_path_base.with_name(f"{checkpoint_path_base.stem}_{mode.replace(' ', '_')}")
#The line below only works for python 3.9+
#checkpoint_path = checkpoint_path_base.with_stem(f"{checkpoint_path_base.stem}_{mode.replace(' ', '_')}")
if mode == "Target":
if target_model is None:
raise ValueError(("Must specify `target_model` when creating this StandardGST, since one could"
Expand Down

0 comments on commit 285c5b6

Please sign in to comment.