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
ed2b7397
Kaydet (Commit)
ed2b7397
authored
Agu 26, 2007
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use unicode and remove support for some uses of str8.
üst
6ea45d33
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
31 deletions
+15
-31
complexobject.c
Objects/complexobject.c
+3
-7
exceptions.c
Objects/exceptions.c
+1
-4
listobject.c
Objects/listobject.c
+6
-2
longobject.c
Objects/longobject.c
+3
-11
moduleobject.c
Objects/moduleobject.c
+2
-7
No files found.
Objects/complexobject.c
Dosyayı görüntüle @
ed2b7397
...
...
@@ -649,11 +649,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
char
s_buffer
[
256
];
Py_ssize_t
len
;
if
(
PyString_Check
(
v
))
{
s
=
PyString_AS_STRING
(
v
);
len
=
PyString_GET_SIZE
(
v
);
}
else
if
(
PyUnicode_Check
(
v
))
{
if
(
PyUnicode_Check
(
v
))
{
if
(
PyUnicode_GET_SIZE
(
v
)
>=
(
Py_ssize_t
)
sizeof
(
s_buffer
))
{
PyErr_SetString
(
PyExc_ValueError
,
"complex() literal too large to convert"
);
...
...
@@ -833,7 +829,7 @@ complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Py_INCREF
(
r
);
return
r
;
}
if
(
Py
String_Check
(
r
)
||
Py
Unicode_Check
(
r
))
{
if
(
PyUnicode_Check
(
r
))
{
if
(
i
!=
NULL
)
{
PyErr_SetString
(
PyExc_TypeError
,
"complex() can't take second arg"
...
...
@@ -842,7 +838,7 @@ complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
return
complex_subtype_from_string
(
type
,
r
);
}
if
(
i
!=
NULL
&&
(
PyString_Check
(
i
)
||
PyUnicode_Check
(
i
)
))
{
if
(
i
!=
NULL
&&
PyUnicode_Check
(
i
))
{
PyErr_SetString
(
PyExc_TypeError
,
"complex() second arg can't be a string"
);
return
NULL
;
...
...
Objects/exceptions.c
Dosyayı görüntüle @
ed2b7397
...
...
@@ -833,10 +833,7 @@ SyntaxError_str(PySyntaxErrorObject *self)
/* XXX -- do all the additional formatting with filename and
lineno here */
if
(
self
->
filename
)
{
if
(
PyString_Check
(
self
->
filename
))
filename
=
PyString_AsString
(
self
->
filename
);
else
if
(
PyUnicode_Check
(
self
->
filename
))
if
(
self
->
filename
&&
PyUnicode_Check
(
self
->
filename
))
{
filename
=
PyUnicode_AsString
(
self
->
filename
);
}
have_lineno
=
(
self
->
lineno
!=
NULL
)
&&
PyInt_CheckExact
(
self
->
lineno
);
...
...
Objects/listobject.c
Dosyayı görüntüle @
ed2b7397
...
...
@@ -1942,6 +1942,7 @@ static int
is_default_cmp
(
PyObject
*
cmpfunc
)
{
PyCFunctionObject
*
f
;
const
char
*
module
;
if
(
cmpfunc
==
NULL
||
cmpfunc
==
Py_None
)
return
1
;
if
(
!
PyCFunction_Check
(
cmpfunc
))
...
...
@@ -1949,9 +1950,12 @@ is_default_cmp(PyObject *cmpfunc)
f
=
(
PyCFunctionObject
*
)
cmpfunc
;
if
(
f
->
m_self
!=
NULL
)
return
0
;
if
(
!
Py
String
_Check
(
f
->
m_module
))
if
(
!
Py
Unicode
_Check
(
f
->
m_module
))
return
0
;
if
(
strcmp
(
PyString_AS_STRING
(
f
->
m_module
),
"__builtin__"
)
!=
0
)
module
=
PyUnicode_AsString
(
f
->
m_module
);
if
(
module
==
NULL
)
return
0
;
if
(
strcmp
(
module
,
"__builtin__"
)
!=
0
)
return
0
;
if
(
strcmp
(
f
->
m_ml
->
ml_name
,
"cmp"
)
!=
0
)
return
0
;
...
...
Objects/longobject.c
Dosyayı görüntüle @
ed2b7397
...
...
@@ -3517,19 +3517,11 @@ long_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return
PyLong_FromLong
(
0L
);
if
(
base
==
-
909
)
return
PyNumber_Long
(
x
);
else
if
(
Py
String_Check
(
x
)
||
Py
Bytes_Check
(
x
))
{
else
if
(
PyBytes_Check
(
x
))
{
/* Since PyLong_FromString doesn't have a length parameter,
* check here for possible NULs in the string. */
char
*
string
;
int
size
;
if
(
PyBytes_Check
(
x
))
{
string
=
PyBytes_AS_STRING
(
x
);
size
=
PyBytes_GET_SIZE
(
x
);
}
else
{
string
=
PyString_AS_STRING
(
x
);
size
=
PyString_GET_SIZE
(
x
);
}
char
*
string
=
PyBytes_AS_STRING
(
x
);
int
size
=
PyBytes_GET_SIZE
(
x
);
if
(
strlen
(
string
)
!=
size
)
{
/* We only see this if there's a null byte in x,
x is a str8 or a bytes, *and* a base is given. */
...
...
Objects/moduleobject.c
Dosyayı görüntüle @
ed2b7397
...
...
@@ -66,17 +66,12 @@ PyModule_GetName(PyObject *m)
d
=
((
PyModuleObject
*
)
m
)
->
md_dict
;
if
(
d
==
NULL
||
(
nameobj
=
PyDict_GetItemString
(
d
,
"__name__"
))
==
NULL
||
!
(
PyString_Check
(
nameobj
)
||
PyUnicode_Check
(
nameobj
)
))
!
PyUnicode_Check
(
nameobj
))
{
PyErr_SetString
(
PyExc_SystemError
,
"nameless module"
);
return
NULL
;
}
if
(
PyUnicode_Check
(
nameobj
))
{
nameobj
=
_PyUnicode_AsDefaultEncodedString
(
nameobj
,
NULL
);
if
(
nameobj
==
NULL
)
return
NULL
;
}
return
PyString_AsString
(
nameobj
);
return
PyUnicode_AsString
(
nameobj
);
}
const
char
*
...
...
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