File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -53,18 +53,22 @@ def get_completion(
5353
5454 if completion :
5555 # Fetch commit from before 30 days ago and checkout
56- commit = next (
57- clone_repo .iter_commits ('HEAD' , max_count = 1 , before = '30 days ago' )
58- )
59- clone_repo .git .checkout (commit .hexsha )
60- with TemporaryDirectory () as tmpdir :
61- month_ago_completion = potodo .merge_and_scan_path (
62- clone_path ,
63- pot_path = Path (clones_dir , 'cpython/Doc/build/gettext' ),
64- merge_path = Path (tmpdir ),
65- hide_reserved = False ,
66- api_url = '' ,
67- ).completion
56+ try :
57+ commit = next (
58+ clone_repo .iter_commits ('HEAD' , max_count = 1 , before = '30 days ago' )
59+ )
60+ except StopIteration :
61+ month_ago_completion = 0.0
62+ else :
63+ clone_repo .git .checkout (commit .hexsha )
64+ with TemporaryDirectory () as tmpdir :
65+ month_ago_completion = potodo .merge_and_scan_path (
66+ clone_path ,
67+ pot_path = Path (clones_dir , 'cpython/Doc/build/gettext' ),
68+ merge_path = Path (tmpdir ),
69+ hide_reserved = False ,
70+ api_url = '' ,
71+ ).completion
6872 else :
6973 month_ago_completion = 0.0
7074
You can’t perform that action at this time.
0 commit comments