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
871309c7
Kaydet (Commit)
871309c7
authored
Mar 26, 2019
tarafından
Inada Naoki
Kaydeden (comit)
Miss Islington (bot)
Mar 26, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-36433: fix confusing error messages in classmethoddescr_call (GH-12556)
https://bugs.python.org/issue36433
üst
b4d8f28a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
test_descr.py
Lib/test/test_descr.py
+18
-3
2019-03-26-17-23-02.bpo-36433.-8XzZf.rst
...ore and Builtins/2019-03-26-17-23-02.bpo-36433.-8XzZf.rst
+1
-0
descrobject.c
Objects/descrobject.c
+4
-6
No files found.
Lib/test/test_descr.py
Dosyayı görüntüle @
871309c7
...
...
@@ -1597,12 +1597,27 @@ order (MRO) for bases """
self
.
assertEqual
(
x2
,
SubSpam
)
self
.
assertEqual
(
a2
,
a1
)
self
.
assertEqual
(
d2
,
d1
)
with
self
.
assertRaises
(
TypeError
):
with
self
.
assertRaises
(
TypeError
)
as
cm
:
spam_cm
()
with
self
.
assertRaises
(
TypeError
):
self
.
assertEqual
(
str
(
cm
.
exception
),
"descriptor 'classmeth' of 'xxsubtype.spamlist' "
"object needs an argument"
)
with
self
.
assertRaises
(
TypeError
)
as
cm
:
spam_cm
(
spam
.
spamlist
())
with
self
.
assertRaises
(
TypeError
):
self
.
assertEqual
(
str
(
cm
.
exception
),
"descriptor 'classmeth' requires a type "
"but received a 'xxsubtype.spamlist' instance"
)
with
self
.
assertRaises
(
TypeError
)
as
cm
:
spam_cm
(
list
)
self
.
assertEqual
(
str
(
cm
.
exception
),
"descriptor 'classmeth' requires a subtype of 'xxsubtype.spamlist' "
"but received 'list'"
)
def
test_staticmethods
(
self
):
# Testing static methods...
...
...
Misc/NEWS.d/next/Core and Builtins/2019-03-26-17-23-02.bpo-36433.-8XzZf.rst
0 → 100644
Dosyayı görüntüle @
871309c7
Fixed TypeError message in classmethoddescr_call.
Objects/descrobject.c
Dosyayı görüntüle @
871309c7
...
...
@@ -315,20 +315,18 @@ classmethoddescr_call(PyMethodDescrObject *descr, PyObject *args,
if
(
!
PyType_Check
(
self
))
{
PyErr_Format
(
PyExc_TypeError
,
"descriptor '%V' requires a type "
"but received a '%.100s'"
,
"but received a '%.100s'
instance
"
,
descr_name
((
PyDescrObject
*
)
descr
),
"?"
,
PyDescr_TYPE
(
descr
)
->
tp_name
,
self
->
ob_type
->
tp_name
);
return
NULL
;
}
if
(
!
PyType_IsSubtype
((
PyTypeObject
*
)
self
,
PyDescr_TYPE
(
descr
)))
{
PyErr_Format
(
PyExc_TypeError
,
"descriptor '%V' "
"requires a subtype of '%.100s' "
"but received '%.100s"
,
"descriptor '%V' requires a subtype of '%.100s' "
"but received '%.100s'"
,
descr_name
((
PyDescrObject
*
)
descr
),
"?"
,
PyDescr_TYPE
(
descr
)
->
tp_name
,
self
->
ob_type
->
tp_name
);
((
PyTypeObject
*
)
self
)
->
tp_name
);
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