Skip to content

Commit b0604fb

Browse files
committed
Remove dead (3.7) references to importlib_metadata.
1 parent 49798a7 commit b0604fb

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

jsonschema/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ def __getattr__(name):
3535
stacklevel=2,
3636
)
3737

38-
try:
39-
from importlib import metadata
40-
except ImportError:
41-
import importlib_metadata as metadata
42-
38+
from importlib import metadata
4339
return metadata.version("jsonschema")
4440
elif name == "RefResolver":
4541
from jsonschema.validators import _RefResolver

jsonschema/cli.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
The ``jsonschema`` command line.
33
"""
44

5+
from importlib import metadata
56
from json import JSONDecodeError
67
from textwrap import dedent
78
import argparse
@@ -10,11 +11,6 @@
1011
import traceback
1112
import warnings
1213

13-
try:
14-
from importlib import metadata
15-
except ImportError:
16-
import importlib_metadata as metadata # type: ignore
17-
1814
try:
1915
from pkgutil import resolve_name
2016
except ImportError:

jsonschema/tests/test_cli.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from contextlib import redirect_stderr, redirect_stdout
2+
from importlib import metadata
23
from io import StringIO
34
from json import JSONDecodeError
45
from pathlib import Path
@@ -11,11 +12,6 @@
1112
import tempfile
1213
import warnings
1314

14-
try: # pragma: no cover
15-
from importlib import metadata
16-
except ImportError: # pragma: no cover
17-
import importlib_metadata as metadata # type: ignore
18-
1915
from jsonschema import Draft4Validator, Draft202012Validator
2016
from jsonschema.exceptions import (
2117
SchemaError,

0 commit comments

Comments
 (0)