mirror of
https://github.com/ultrajson/ultrajson.git
synced 2024-05-06 21:16:19 +02:00
commit
f26f9679f1
|
@ -258,7 +258,9 @@ static int Dict_iterNext(JSOBJ obj, JSONTypeContext *tc)
|
|||
{
|
||||
if (UNLIKELY(GET_TC(tc)->itemName == Py_None))
|
||||
{
|
||||
GET_TC(tc)->itemName = PyUnicode_FromString("null");
|
||||
itemNameTmp = PyUnicode_FromString("null");
|
||||
GET_TC(tc)->itemName = PyUnicode_AsUTF8String(itemNameTmp);
|
||||
Py_DECREF(Py_None);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -537,19 +539,19 @@ static void Object_beginTypeContext (JSOBJ _obj, JSONTypeContext *tc, JSONObject
|
|||
return;
|
||||
}
|
||||
else
|
||||
if (PyFloat_Check(obj) || object_is_decimal_type(obj))
|
||||
{
|
||||
PRINTMARK();
|
||||
pc->PyTypeToJSON = PyFloatToDOUBLE; tc->type = JT_DOUBLE;
|
||||
return;
|
||||
}
|
||||
else
|
||||
if (obj == Py_None)
|
||||
{
|
||||
PRINTMARK();
|
||||
tc->type = JT_NULL;
|
||||
return;
|
||||
}
|
||||
else
|
||||
if (PyFloat_Check(obj) || object_is_decimal_type(obj))
|
||||
{
|
||||
PRINTMARK();
|
||||
pc->PyTypeToJSON = PyFloatToDOUBLE; tc->type = JT_DOUBLE;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ISITERABLE:
|
||||
|
|
|
@ -806,6 +806,11 @@ def test_reject_bytes_false():
|
|||
assert ujson.dumps(data, reject_bytes=False) == '{"a":"b"}'
|
||||
|
||||
|
||||
def test_encode_none_key():
|
||||
data = {None: None}
|
||||
assert ujson.dumps(data) == '{"null":null}'
|
||||
|
||||
|
||||
"""
|
||||
def test_decode_numeric_int_frc_overflow():
|
||||
input = "X.Y"
|
||||
|
|
Loading…
Reference in New Issue