Skip to content

Commit

Permalink
Filter out deprecation warnings from main entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Feb 8, 2024
1 parent 7146cf9 commit de7c7ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ert/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import re
import sys
import warnings
from argparse import ArgumentParser, ArgumentTypeError
from typing import Any, Dict, Optional, Sequence, Union
from uuid import UUID
Expand Down Expand Up @@ -531,6 +532,7 @@ def log_process_usage() -> None:
def main() -> None:
import locale

warnings.filterwarnings("ignore", category=DeprecationWarning)
locale.setlocale(locale.LC_NUMERIC, "C")

args = ert_parser(None, sys.argv[1:])
Expand Down
2 changes: 2 additions & 0 deletions src/ert/services/_storage_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import socket
import sys
import warnings
from typing import Any, Dict, List, Optional, Union

import uvicorn
Expand Down Expand Up @@ -177,6 +178,7 @@ def terminate_on_parent_death() -> None:
with open(STORAGE_LOG_CONFIG, encoding="utf-8") as conf_file:
logging_conf = yaml.safe_load(conf_file)
logging.config.dictConfig(logging_conf)
warnings.filterwarnings("ignore", category=DeprecationWarning)
uvicorn.config.LOGGING_CONFIG.clear()
uvicorn.config.LOGGING_CONFIG.update(logging_conf)
terminate_on_parent_death()
Expand Down

0 comments on commit de7c7ed

Please sign in to comment.