diff options
Diffstat (limited to 'sphinx/util/jsdump.py')
-rw-r--r-- | sphinx/util/jsdump.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sphinx/util/jsdump.py b/sphinx/util/jsdump.py index ed5aea4ba..77acef9d2 100644 --- a/sphinx/util/jsdump.py +++ b/sphinx/util/jsdump.py @@ -6,6 +6,8 @@ Uses the basestring encode function from simplejson by Bob Ippolito. import re from typing import IO, Any, Dict, List, Match, Union +from sphinx.deprecation import RemovedInSphinx70Warning, deprecated_alias + _str_re = re.compile(r'"(\\\\|\\"|[^"])*"') _int_re = re.compile(r'\d+') _name_re = re.compile(r'[a-zA-Z_]\w*') @@ -192,3 +194,21 @@ 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', + } +) |