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
a7b0976c
Kaydet (Commit)
a7b0976c
authored
Eki 15, 2011
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
PyEval_CallObject requires a tuple of args (closes #13186)
üst
5baef6d2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
1 deletion
+31
-1
test_class.py
Lib/test/test_class.py
+13
-0
NEWS
Misc/NEWS
+3
-0
_testcapimodule.c
Modules/_testcapimodule.c
+14
-0
classobject.c
Objects/classobject.c
+1
-1
No files found.
Lib/test/test_class.py
Dosyayı görüntüle @
a7b0976c
...
@@ -350,6 +350,19 @@ class ClassTests(unittest.TestCase):
...
@@ -350,6 +350,19 @@ class ClassTests(unittest.TestCase):
AllTests
.
__delslice__
=
delslice
AllTests
.
__delslice__
=
delslice
@test_support.cpython_only
def
testDelItem
(
self
):
class
A
:
ok
=
False
def
__delitem__
(
self
,
key
):
self
.
ok
=
True
a
=
A
()
# Subtle: we need to call PySequence_SetItem, not PyMapping_SetItem.
from
_testcapi
import
sequence_delitem
sequence_delitem
(
a
,
2
)
self
.
assertTrue
(
a
.
ok
)
def
testUnaryOps
(
self
):
def
testUnaryOps
(
self
):
testme
=
AllTests
()
testme
=
AllTests
()
...
...
Misc/NEWS
Dosyayı görüntüle @
a7b0976c
...
@@ -9,6 +9,9 @@ What's New in Python 2.7.3?
...
@@ -9,6 +9,9 @@ What's New in Python 2.7.3?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #13186: Fix __delitem__ on old-style instances when invoked through
PySequence_DelItem.
- Issue #13156: Revert the patch for issue #10517 (reset TLS upon fork()),
- Issue #13156: Revert the patch for issue #10517 (reset TLS upon fork()),
which was only relevant for the native pthread TLS implementation.
which was only relevant for the native pthread TLS implementation.
...
...
Modules/_testcapimodule.c
Dosyayı görüntüle @
a7b0976c
...
@@ -1639,6 +1639,19 @@ make_exception_with_doc(PyObject *self, PyObject *args, PyObject *kwargs)
...
@@ -1639,6 +1639,19 @@ make_exception_with_doc(PyObject *self, PyObject *args, PyObject *kwargs)
return
PyErr_NewExceptionWithDoc
(
name
,
doc
,
base
,
dict
);
return
PyErr_NewExceptionWithDoc
(
name
,
doc
,
base
,
dict
);
}
}
static
PyObject
*
sequence_delitem
(
PyObject
*
self
,
PyObject
*
args
)
{
PyObject
*
seq
;
Py_ssize_t
i
;
if
(
!
PyArg_ParseTuple
(
args
,
"On"
,
&
seq
,
&
i
))
return
NULL
;
if
(
PySequence_DelItem
(
seq
,
i
)
<
0
)
return
NULL
;
Py_RETURN_NONE
;
}
static
PyMethodDef
TestMethods
[]
=
{
static
PyMethodDef
TestMethods
[]
=
{
{
"raise_exception"
,
raise_exception
,
METH_VARARGS
},
{
"raise_exception"
,
raise_exception
,
METH_VARARGS
},
{
"test_config"
,
(
PyCFunction
)
test_config
,
METH_NOARGS
},
{
"test_config"
,
(
PyCFunction
)
test_config
,
METH_NOARGS
},
...
@@ -1695,6 +1708,7 @@ static PyMethodDef TestMethods[] = {
...
@@ -1695,6 +1708,7 @@ static PyMethodDef TestMethods[] = {
{
"code_newempty"
,
code_newempty
,
METH_VARARGS
},
{
"code_newempty"
,
code_newempty
,
METH_VARARGS
},
{
"make_exception_with_doc"
,
(
PyCFunction
)
make_exception_with_doc
,
{
"make_exception_with_doc"
,
(
PyCFunction
)
make_exception_with_doc
,
METH_VARARGS
|
METH_KEYWORDS
},
METH_VARARGS
|
METH_KEYWORDS
},
{
"sequence_delitem"
,
(
PyCFunction
)
sequence_delitem
,
METH_VARARGS
},
{
NULL
,
NULL
}
/* sentinel */
{
NULL
,
NULL
}
/* sentinel */
};
};
...
...
Objects/classobject.c
Dosyayı görüntüle @
a7b0976c
...
@@ -1221,7 +1221,7 @@ instance_ass_item(PyInstanceObject *inst, Py_ssize_t i, PyObject *item)
...
@@ -1221,7 +1221,7 @@ instance_ass_item(PyInstanceObject *inst, Py_ssize_t i, PyObject *item)
if
(
func
==
NULL
)
if
(
func
==
NULL
)
return
-
1
;
return
-
1
;
if
(
item
==
NULL
)
if
(
item
==
NULL
)
arg
=
Py
Int_FromSsize_t
(
i
);
arg
=
Py
_BuildValue
(
"(n)"
,
i
);
else
else
arg
=
Py_BuildValue
(
"(nO)"
,
i
,
item
);
arg
=
Py_BuildValue
(
"(nO)"
,
i
,
item
);
if
(
arg
==
NULL
)
{
if
(
arg
==
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