| |
@@ -6,7 +6,10 @@
|
| |
from pathlib import Path
|
| |
from sys import exit, stderr
|
| |
|
| |
- import toml
|
| |
+ try:
|
| |
+ import tomllib
|
| |
+ except ImportError:
|
| |
+ import tomli as tomllib
|
| |
|
| |
|
| |
def main():
|
| |
@@ -124,7 +127,7 @@
|
| |
parser.add_argument(
|
| |
"-x",
|
| |
"--exceptions",
|
| |
- type=FileType("r"),
|
| |
+ type=FileType("rb"),
|
| |
help="Manually audited package versions file",
|
| |
)
|
| |
parser.add_argument(
|
| |
@@ -149,7 +152,7 @@
|
| |
else:
|
| |
with args.exceptions as xfile:
|
| |
xname = getattr(xfile, "name", "<exceptions>")
|
| |
- args.exceptions = toml.load(args.exceptions)
|
| |
+ args.exceptions = tomllib.load(args.exceptions)
|
| |
if not isinstance(args.exceptions, dict):
|
| |
parser.error(f"Invalid format in {xname}: not an object")
|
| |
for tablename, table in args.exceptions.items():
|
| |