Skip to content

Commit 05ea559

Browse files
Copilotilaflott
andauthored
Add -> NoReturn annotation to log_and_raise to fix pylint possibly-used-before-assignment errors
Agent-Logs-Url: https://github.com/NOAA-GFDL/fre-cli/sessions/6e92661a-f061-4b23-a675-7ddeb69b0a21 Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
1 parent 4930028 commit 05ea559

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fre/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import logging
66
import os
7+
from typing import NoReturn
78
version = os.getenv("GIT_DESCRIBE_TAG", "2026.01.alpha2")
89
__version__ = version
910

@@ -16,7 +17,7 @@
1617
encoding = 'utf-8' )
1718

1819

19-
def log_and_raise(msg, exc_type=ValueError, exc=None):
20+
def log_and_raise(msg, exc_type=ValueError, exc=None) -> NoReturn:
2021
"""
2122
Log an error message via fre_logger and raise an exception with the same message.
2223
Avoids the need to duplicate error text in both fre_logger.error() and raise calls.

0 commit comments

Comments
 (0)