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
ffd84961
Kaydet (Commit)
ffd84961
authored
Ock 26, 2010
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#7092: fix DeprecationWarnings for json when the tests are run with -3 -Wd.
üst
ef97caf1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
decoder.py
Lib/json/decoder.py
+4
-2
encoder.py
Lib/json/encoder.py
+1
-4
test_dump.py
Lib/json/tests/test_dump.py
+2
-2
No files found.
Lib/json/decoder.py
Dosyayı görüntüle @
ffd84961
...
...
@@ -146,8 +146,9 @@ scanstring = c_scanstring or py_scanstring
WHITESPACE
=
re
.
compile
(
r'[ \t\n\r]*'
,
FLAGS
)
WHITESPACE_STR
=
'
\t\n\r
'
def
JSONObject
(
(
s
,
end
)
,
encoding
,
strict
,
scan_once
,
object_hook
,
def
JSONObject
(
s_and_end
,
encoding
,
strict
,
scan_once
,
object_hook
,
object_pairs_hook
,
_w
=
WHITESPACE
.
match
,
_ws
=
WHITESPACE_STR
):
s
,
end
=
s_and_end
pairs
=
[]
pairs_append
=
pairs
.
append
# Use a slice to prevent IndexError from being raised, the following
...
...
@@ -227,7 +228,8 @@ def JSONObject((s, end), encoding, strict, scan_once, object_hook,
pairs
=
object_hook
(
pairs
)
return
pairs
,
end
def
JSONArray
((
s
,
end
),
scan_once
,
_w
=
WHITESPACE
.
match
,
_ws
=
WHITESPACE_STR
):
def
JSONArray
(
s_and_end
,
scan_once
,
_w
=
WHITESPACE
.
match
,
_ws
=
WHITESPACE_STR
):
s
,
end
=
s_and_end
values
=
[]
nextchar
=
s
[
end
:
end
+
1
]
if
nextchar
in
_ws
:
...
...
Lib/json/encoder.py
Dosyayı görüntüle @
ffd84961
...
...
@@ -266,8 +266,6 @@ class JSONEncoder(object):
def
_make_iterencode
(
markers
,
_default
,
_encoder
,
_indent
,
_floatstr
,
_key_separator
,
_item_separator
,
_sort_keys
,
_skipkeys
,
_one_shot
,
## HACK: hand-optimized bytecode; turn globals into locals
False
=
False
,
True
=
True
,
ValueError
=
ValueError
,
basestring
=
basestring
,
dict
=
dict
,
...
...
@@ -354,8 +352,7 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
item_separator
=
_item_separator
first
=
True
if
_sort_keys
:
items
=
dct
.
items
()
items
.
sort
(
key
=
lambda
kv
:
kv
[
0
])
items
=
sorted
(
dct
.
items
(),
key
=
lambda
kv
:
kv
[
0
])
else
:
items
=
dct
.
iteritems
()
for
key
,
value
in
items
:
...
...
Lib/json/tests/test_dump.py
Dosyayı görüntüle @
ffd84961
...
...
@@ -17,5 +17,5 @@ class TestDump(TestCase):
{
True
:
False
,
False
:
True
},
sort_keys
=
True
),
'{"false": true, "true": false}'
)
self
.
assertEquals
(
json
.
dumps
(
{
2
:
3.0
,
4.0
:
5L
,
False
:
1
,
6L
:
True
,
"7"
:
0
},
sort_keys
=
True
),
'{"false": 1, "2": 3.0, "4.0": 5, "6": true
, "7": 0
}'
)
{
2
:
3.0
,
4.0
:
5L
,
False
:
1
,
6L
:
True
},
sort_keys
=
True
),
'{"false": 1, "2": 3.0, "4.0": 5, "6": true}'
)
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