Skip to content

Commit 6f080c9

Browse files
Apply other suggestions
1 parent 4e8471f commit 6f080c9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

completion.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import json
2-
import subprocess
32
from dataclasses import dataclass
43
from functools import cache
54
from pathlib import Path
@@ -48,7 +47,7 @@ def get_completion(
4847
api_url='',
4948
).completion
5049

51-
try:
50+
if completion:
5251
# Fetch commit from before 30 days ago and checkout
5352
repo = git.Repo(clone_path)
5453
commit = next(repo.iter_commits('HEAD', max_count=1, before="30 days ago"))
@@ -57,11 +56,11 @@ def get_completion(
5756
month_ago_completion = potodo.merge_and_scan_path(
5857
clone_path,
5958
pot_path=Path(clones_dir, 'cpython/Doc/build/gettext'),
60-
merge_path=Path(tmpdir2),
59+
merge_path=Path(tmpdir),
6160
hide_reserved=False,
6261
api_url='',
6362
).completion
64-
except Exception:
63+
else:
6564
print(f'{repo} is empty')
6665
month_ago_completion = 0.0
6766

0 commit comments

Comments
 (0)