diff --git a/src/black/schema.py b/src/black/schema.py index af34bd8528a..78e9564cdbc 100644 --- a/src/black/schema.py +++ b/src/black/schema.py @@ -8,12 +8,13 @@ def get_schema(tool_name: str = "black") -> Any: """Get the stored complete schema for black's settings.""" assert tool_name == "black", "Only black is supported." - loc = "resources/black.schema.json" + pkg = "black.resources" + fname = "black.schema.json" if sys.version_info < (3, 9): - with importlib.resources.open_text("black", loc, encoding="utf-8") as f: + with importlib.resources.open_text(pkg, fname, encoding="utf-8") as f: return json.load(f) - schema = importlib.resources.files("black").joinpath(loc) # type: ignore[unreachable] + schema = importlib.resources.files(pkg).joinpath(fname) # type: ignore[unreachable] with schema.open(encoding="utf-8") as f: return json.load(f)