Skip to content

Commit 65427ba

Browse files
committed
[terminal] updated typing for new rapidfuzz
1 parent 4003232 commit 65427ba

File tree

1 file changed

+9
-2
lines changed
  • src/instrumentman/terminal

1 file changed

+9
-2
lines changed

src/instrumentman/terminal/app.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,15 @@ async def get_suggestion(self, value: str) -> str | None:
244244

245245
separator = "." if path != "" else ""
246246

247-
suggestion = process.extractOne(
248-
partial, suggest, scorer=fuzz.partial_ratio)[0]
247+
extracted = process.extractOne(
248+
partial,
249+
suggest,
250+
scorer=fuzz.partial_ratio
251+
)
252+
if extracted is None:
253+
return None
254+
255+
suggestion = extracted[0]
249256

250257
return f"{path}{separator}{suggestion}"
251258

0 commit comments

Comments
 (0)