Skip to content

Commit 2dc8e75

Browse files
committed
Deprecate built-in cjson support.
1 parent fe837b1 commit 2dc8e75

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

couchdb/json.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
__all__ = ['decode', 'encode', 'use']
3535

36+
import warnings
3637
import os
3738

3839
_initialized = False
@@ -71,8 +72,8 @@ def use(module=None, decode=None, encode=None):
7172
"""Set the JSON library that should be used, either by specifying a known
7273
module name, or by providing a decode and encode function.
7374
74-
The modules "simplejson", "cjson", and "json" are currently supported for
75-
the ``module`` parameter.
75+
The modules "simplejson" and "json" are currently supported for the
76+
``module`` parameter.
7677
7778
If provided, the ``decode`` parameter must be a callable that accepts a
7879
JSON string and returns a corresponding Python data structure. The
@@ -130,6 +131,10 @@ def _init_stdlib():
130131
if _using == 'simplejson':
131132
_init_simplejson()
132133
elif _using == 'cjson':
134+
warnings.warn("Builtin cjson support is deprecated. Please use the "
135+
"default or provide custom decode/encode functions "
136+
"[2011-11-09].",
137+
DeprecationWarning, stacklevel=1)
133138
_init_cjson()
134139
elif _using == 'json':
135140
_init_stdlib()

0 commit comments

Comments
 (0)