summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2014-09-24 16:23:41 -0700
committerBob Ippolito <bob@redivi.com>2014-09-24 16:23:41 -0700
commitc510dd0285bbce594fd772b462eb859a39bf4a9f (patch)
tree778a6a777fc045ec585d05273d7c6bd6a28c96ce
parent2e83d7cc9388678ef750f7ccfa30947eed47e73d (diff)
downloadsimplejson-c510dd0285bbce594fd772b462eb859a39bf4a9f.tar.gz
ensure cached encoder is only used when all settings are defaultsort_keys_dump-106
-rw-r--r--simplejson/__init__.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/simplejson/__init__.py b/simplejson/__init__.py
index a02c4de..1dd5a71 100644
--- a/simplejson/__init__.py
+++ b/simplejson/__init__.py
@@ -243,8 +243,11 @@ def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True,
cls is None and indent is None and separators is None and
encoding == 'utf-8' and default is None and use_decimal
and namedtuple_as_object and tuple_as_array
- and not bigint_as_string and int_as_string_bitcount is None
- and not item_sort_key and not for_json and not ignore_nan and not kw):
+ and not bigint_as_string and not sort_keys
+ and not item_sort_key and not for_json
+ and not ignore_nan and int_as_string_bitcount is None
+ and not kw
+ ):
iterable = _default_encoder.iterencode(obj)
else:
if cls is None:
@@ -359,9 +362,10 @@ def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True,
cls is None and indent is None and separators is None and
encoding == 'utf-8' and default is None and use_decimal
and namedtuple_as_object and tuple_as_array
- and not bigint_as_string and int_as_string_bitcount is None
- and not sort_keys and not item_sort_key and not for_json
- and not ignore_nan and not kw
+ and not bigint_as_string and not sort_keys
+ and not item_sort_key and not for_json
+ and not ignore_nan and int_as_string_bitcount is None
+ and not kw
):
return _default_encoder.encode(obj)
if cls is None: