examples: fix handling "--last" argument in "examples/python/gi/checkpoint.py"

Fixes: 3ce3ed4c92 ('examples: improve finding last checkpoint in "checkpoint.py"')
This commit is contained in:
Thomas Haller 2022-12-09 10:16:16 +01:00
parent 176f1928d4
commit 135bbcc0e4
No known key found for this signature in database
GPG Key ID: 29C2366E4DFC5728

View File

@ -80,10 +80,10 @@ def find_checkpoint_last(nmc):
def validate_path(path, nmc):
if path == "--last":
path = find_checkpoint_last(nmc)
if path is None:
c = find_checkpoint_last(nmc)
if c is None:
sys.exit("Has no checkpoint")
return path
return c.get_path()
try:
num = int(path)