Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f31db93f
Kaydet (Commit)
f31db93f
authored
Tem 21, 2010
tarafından
Doug Hellmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Apply patch from Ray Allen for issue 9296
üst
8c4fa115
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
test_fail.py
Lib/json/tests/test_fail.py
+9
-0
_json.c
Modules/_json.c
+1
-1
No files found.
Lib/json/tests/test_fail.py
Dosyayı görüntüle @
f31db93f
...
@@ -74,3 +74,12 @@ class TestFail(TestCase):
...
@@ -74,3 +74,12 @@ class TestFail(TestCase):
pass
pass
else
:
else
:
self
.
fail
(
"Expected failure for fail{0}.json: {1!r}"
.
format
(
idx
,
doc
))
self
.
fail
(
"Expected failure for fail{0}.json: {1!r}"
.
format
(
idx
,
doc
))
def
test_non_string_keys_dict
(
self
):
data
=
{
'a'
:
1
,
(
1
,
2
)
:
2
}
#This is for c encoder
self
.
assertRaises
(
TypeError
,
json
.
dumps
,
data
)
#This is for python encoder
self
.
assertRaises
(
TypeError
,
json
.
dumps
,
data
,
indent
=
True
)
Modules/_json.c
Dosyayı görüntüle @
f31db93f
...
@@ -2147,7 +2147,7 @@ encoder_listencode_dict(PyEncoderObject *s, PyObject *rval, PyObject *dct, Py_ss
...
@@ -2147,7 +2147,7 @@ encoder_listencode_dict(PyEncoderObject *s, PyObject *rval, PyObject *dct, Py_ss
}
}
else
{
else
{
/* TODO: include repr of key */
/* TODO: include repr of key */
PyErr_SetString
(
PyExc_
Valu
eError
,
"keys must be a string"
);
PyErr_SetString
(
PyExc_
Typ
eError
,
"keys must be a string"
);
goto
bail
;
goto
bail
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment