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
cbb02846
Kaydet (Commit)
cbb02846
authored
Ara 01, 2012
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #16590: remove obsolete compatibility code from the _json module.
Patch by Serhiy Storchaka.
üst
f02f280b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
40 deletions
+5
-40
_json.c
Modules/_json.c
+5
-40
No files found.
Modules/_json.c
Dosyayı görüntüle @
cbb02846
...
...
@@ -2,20 +2,6 @@
#include "structmember.h"
#include "accu.h"
#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TYPE)
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
#endif
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef
int
Py_ssize_t
;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#define PyInt_FromSsize_t PyInt_FromLong
#define PyInt_AsSsize_t PyInt_AsLong
#endif
#ifndef Py_IS_FINITE
#define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X))
#endif
#ifdef __GNUC__
#define UNUSED __attribute__((__unused__))
#else
...
...
@@ -129,33 +115,12 @@ static void
raise_errmsg
(
char
*
msg
,
PyObject
*
s
,
Py_ssize_t
end
);
static
PyObject
*
encoder_encode_string
(
PyEncoderObject
*
s
,
PyObject
*
obj
);
static
int
_convertPyInt_AsSsize_t
(
PyObject
*
o
,
Py_ssize_t
*
size_ptr
);
static
PyObject
*
_convertPyInt_FromSsize_t
(
Py_ssize_t
*
size_ptr
);
static
PyObject
*
encoder_encode_float
(
PyEncoderObject
*
s
,
PyObject
*
obj
);
#define S_CHAR(c) (c >= ' ' && c <= '~' && c != '\\' && c != '"')
#define IS_WHITESPACE(c) (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || ((c) == '\r'))
static
int
_convertPyInt_AsSsize_t
(
PyObject
*
o
,
Py_ssize_t
*
size_ptr
)
{
/* PyObject to Py_ssize_t converter */
*
size_ptr
=
PyLong_AsSsize_t
(
o
);
if
(
*
size_ptr
==
-
1
&&
PyErr_Occurred
())
return
0
;
return
1
;
}
static
PyObject
*
_convertPyInt_FromSsize_t
(
Py_ssize_t
*
size_ptr
)
{
/* Py_ssize_t to PyObject converter */
return
PyLong_FromSsize_t
(
*
size_ptr
);
}
static
Py_ssize_t
ascii_escape_unichar
(
Py_UCS4
c
,
unsigned
char
*
output
,
Py_ssize_t
chars
)
{
...
...
@@ -265,7 +230,7 @@ raise_errmsg(char *msg, PyObject *s, Py_ssize_t end)
if
(
errmsg_fn
==
NULL
)
return
;
}
pymsg
=
PyObject_CallFunction
(
errmsg_fn
,
"(zO
O&)"
,
msg
,
s
,
_convertPyInt_FromSsize_t
,
&
end
);
pymsg
=
PyObject_CallFunction
(
errmsg_fn
,
"(zO
n)"
,
msg
,
s
,
end
);
if
(
pymsg
)
{
PyErr_SetObject
(
PyExc_ValueError
,
pymsg
);
Py_DECREF
(
pymsg
);
...
...
@@ -524,7 +489,7 @@ py_scanstring(PyObject* self UNUSED, PyObject *args)
Py_ssize_t
end
;
Py_ssize_t
next_end
=
-
1
;
int
strict
=
1
;
if
(
!
PyArg_ParseTuple
(
args
,
"O
O&|i:scanstring"
,
&
pystr
,
_convertPyInt_AsSsize_t
,
&
end
,
&
strict
))
{
if
(
!
PyArg_ParseTuple
(
args
,
"O
n|i:scanstring"
,
&
pystr
,
&
end
,
&
strict
))
{
return
NULL
;
}
if
(
PyUnicode_Check
(
pystr
))
{
...
...
@@ -1087,7 +1052,7 @@ scanner_call(PyObject *self, PyObject *args, PyObject *kwds)
PyScannerObject
*
s
;
assert
(
PyScanner_Check
(
self
));
s
=
(
PyScannerObject
*
)
self
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"O
O&:scan_once"
,
kwlist
,
&
pystr
,
_convertPyInt_AsSsize_t
,
&
idx
))
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"O
n:scan_once"
,
kwlist
,
&
pystr
,
&
idx
))
return
NULL
;
if
(
PyUnicode_Check
(
pystr
))
{
...
...
@@ -1288,8 +1253,8 @@ encoder_call(PyObject *self, PyObject *args, PyObject *kwds)
assert
(
PyEncoder_Check
(
self
));
s
=
(
PyEncoderObject
*
)
self
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"O
O&
:_iterencode"
,
kwlist
,
&
obj
,
_convertPyInt_AsSsize_t
,
&
indent_level
))
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"O
n
:_iterencode"
,
kwlist
,
&
obj
,
&
indent_level
))
return
NULL
;
if
(
_PyAccu_Init
(
&
acc
))
return
NULL
;
...
...
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