From 31f87e78ac2206db4abc013b787bb6fd6771efbf Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Sun, 1 May 2022 05:49:59 +0100 Subject: [PATCH] Review comments --- sphinx/util/jsdump.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/sphinx/util/jsdump.py b/sphinx/util/jsdump.py index 77acef9d2..484f35b7e 100644 --- a/sphinx/util/jsdump.py +++ b/sphinx/util/jsdump.py @@ -4,9 +4,13 @@ Uses the basestring encode function from simplejson by Bob Ippolito. """ import re +import warnings from typing import IO, Any, Dict, List, Match, Union -from sphinx.deprecation import RemovedInSphinx70Warning, deprecated_alias +from sphinx.deprecation import RemovedInSphinx70Warning + +warnings.warn('"sphinx.util.jsdump" has been deprecated. Please use "json" instead.', + RemovedInSphinx70Warning) _str_re = re.compile(r'"(\\\\|\\"|[^"])*"') _int_re = re.compile(r'\d+') @@ -194,21 +198,3 @@ def loads(x: str) -> Any: def load(f: IO) -> Any: return loads(f.read()) - - -deprecated_alias( - 'sphinx.util.jsdump', - { - 'dumps': dumps, - 'dump': dump, - 'loads': loads, - 'load': load, - }, - RemovedInSphinx70Warning, - { - 'dumps': 'json.dumps', - 'dump': 'json.dump', - 'loads': 'json.loads', - 'load': 'json.load', - } -)