mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-23 11:15:13 +03:00
28 lines
981 B
Diff
28 lines
981 B
Diff
diff --git a/notus/scanner/config.py b/notus/scanner/config.py
|
|
index d3c18e0..f03114e 100644
|
|
--- a/notus/scanner/config.py
|
|
+++ b/notus/scanner/config.py
|
|
@@ -24,7 +24,7 @@ import os
|
|
from pathlib import Path
|
|
from typing import Any, Dict
|
|
|
|
-import tomli
|
|
+import tomllib
|
|
|
|
from notus.scanner.errors import ConfigFileError
|
|
|
|
@@ -70,12 +70,12 @@ class Config:
|
|
def load(self, filepath: Path) -> None:
|
|
try:
|
|
content = filepath.read_text(encoding="utf-8")
|
|
- config_data = tomli.loads(content)
|
|
+ config_data = tomllib.loads(content)
|
|
except IOError as e:
|
|
raise ConfigFileError(
|
|
f"Can't load config file {filepath.absolute()}. Error was {e}."
|
|
) from e
|
|
- except tomli.TOMLDecodeError as e:
|
|
+ except tomllib.TOMLDecodeError as e:
|
|
raise ConfigFileError(
|
|
f"Can't load config file. {filepath.absolute()} is not a valid "
|
|
"TOML file."
|