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 @@ -49,18 +49,22 @@ def get_completion(
4949
5050 if completion :
5151 # Fetch commit from before 30 days ago and checkout
52- commit = next (
53- clone_repo .iter_commits ('HEAD' , max_count = 1 , before = '30 days ago' )
54- )
55- clone_repo .git .checkout (commit .hexsha )
56- with TemporaryDirectory () as tmpdir :
57- month_ago_completion = potodo .merge_and_scan_path (
58- clone_path ,
59- pot_path = Path (clones_dir , 'cpython/Doc/build/gettext' ),
60- merge_path = Path (tmpdir ),
61- hide_reserved = False ,
62- api_url = '' ,
63- ).completion
52+ try :
53+ commit = next (
54+ clone_repo .iter_commits ('HEAD' , max_count = 1 , before = '30 days ago' )
55+ )
56+ except StopIteration :
57+ month_ago_completion = 0.0
58+ else :
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
6468 else :
6569 month_ago_completion = 0.0
6670
You can’t perform that action at this time.
0 commit comments