Skip to content

Commit

Permalink
fix typings, runtimewarning on none
Browse files Browse the repository at this point in the history
  • Loading branch information
devkral committed Jan 3, 2025
1 parent 9bfb188 commit e92baf3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions asyncz/stores/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ def __init__(
self.cleanup_directory = cleanup_directory
self.suffix = suffix

def check_task_id(self, task_id) -> None:
def check_task_id(self, task_id: str | None) -> None:
if task_id is None:
raise RuntimeError("Task id is None")
if task_id.startswith("."):
raise RuntimeError(f'Invalid character in task id: "{task_id}"')
raise RuntimeError(f'Invalid character in task id: "{task_id}".')
for char in task_id:
if char in self.forbidden_characters:
raise RuntimeError(f'Invalid character in task id: "{task_id}"')
raise RuntimeError(f'Invalid character in task id: "{task_id}".')

def start(self, scheduler: Any, alias: str) -> None:
"""
Expand Down

0 comments on commit e92baf3

Please sign in to comment.