diff --git a/importlib_metadata/__init__.py b/importlib_metadata/__init__.py index e9af4972..d1b0d92d 100644 --- a/importlib_metadata/__init__.py +++ b/importlib_metadata/__init__.py @@ -14,7 +14,6 @@ import email import functools import itertools -import json import operator import os import pathlib @@ -673,6 +672,8 @@ def origin(self): return self._load_json('direct_url.json') def _load_json(self, filename): + import json + return pass_none(json.loads)( self.read_text(filename), object_hook=lambda data: types.SimpleNamespace(**data),