Skip to content

Commit

Permalink
Update errors.py to make Ruff happy
Browse files Browse the repository at this point in the history
This includes replacing `from sys import exit` with `import sys` and then using `sys.exit()` instead. Ruff complains about `exit` shadowing a built-in.
  • Loading branch information
pkhalaj authored Dec 5, 2024
1 parent 9d1d78e commit ac7ffe4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trolldb/errors/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

from collections import OrderedDict
from sys import exit
import sys
from typing import ClassVar, NoReturn, Self

from fastapi import Response
Expand Down Expand Up @@ -226,7 +226,7 @@ def sys_exit_log(
"""
_, msg = self.get_error_details(extra_information, status_code)
logger.error(msg)
exit(exit_code)
sys.exit(exit_code)

@property
def fastapi_descriptor(self) -> dict[StatusCode, dict[str, str]]:
Expand Down

0 comments on commit ac7ffe4

Please sign in to comment.