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
83245b58
Kaydet (Commit)
83245b58
authored
Mar 12, 2003
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SF bug #699934: Obscure error message
Clarify error message for mro conflicts.
üst
45c39415
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
test_descr.py
Lib/test/test_descr.py
+7
-3
typeobject.c
Objects/typeobject.c
+4
-1
No files found.
Lib/test/test_descr.py
Dosyayı görüntüle @
83245b58
...
@@ -1062,6 +1062,10 @@ def consistency_with_epg():
...
@@ -1062,6 +1062,10 @@ def consistency_with_epg():
(
EditableScrollablePane
,
ScrollablePane
,
EditablePane
,
(
EditableScrollablePane
,
ScrollablePane
,
EditablePane
,
Pane
,
ScrollingMixin
,
EditingMixin
,
object
))
Pane
,
ScrollingMixin
,
EditingMixin
,
object
))
mro_err_msg
=
"""Cannot create class.The superclasses have conflicting
inheritance trees which leave the method resolution order (MRO)
undefined for bases """
def
mro_disagreement
():
def
mro_disagreement
():
if
verbose
:
print
"Testing error messages for MRO disagreement..."
if
verbose
:
print
"Testing error messages for MRO disagreement..."
def
raises
(
exc
,
expected
,
callable
,
*
args
):
def
raises
(
exc
,
expected
,
callable
,
*
args
):
...
@@ -1079,9 +1083,9 @@ def mro_disagreement():
...
@@ -1079,9 +1083,9 @@ def mro_disagreement():
# Test some very simple errors
# Test some very simple errors
raises
(
TypeError
,
"duplicate base class A"
,
raises
(
TypeError
,
"duplicate base class A"
,
type
,
"X"
,
(
A
,
A
),
{})
type
,
"X"
,
(
A
,
A
),
{})
raises
(
TypeError
,
"MRO conflict among bases "
,
raises
(
TypeError
,
mro_err_msg
,
type
,
"X"
,
(
A
,
B
),
{})
type
,
"X"
,
(
A
,
B
),
{})
raises
(
TypeError
,
"MRO conflict among bases "
,
raises
(
TypeError
,
mro_err_msg
,
type
,
"X"
,
(
A
,
C
,
B
),
{})
type
,
"X"
,
(
A
,
C
,
B
),
{})
# Test a slightly more complex error
# Test a slightly more complex error
class
GridLayout
(
object
):
pass
class
GridLayout
(
object
):
pass
...
@@ -1089,7 +1093,7 @@ def mro_disagreement():
...
@@ -1089,7 +1093,7 @@ def mro_disagreement():
class
VerticalGrid
(
GridLayout
):
pass
class
VerticalGrid
(
GridLayout
):
pass
class
HVGrid
(
HorizontalGrid
,
VerticalGrid
):
pass
class
HVGrid
(
HorizontalGrid
,
VerticalGrid
):
pass
class
VHGrid
(
VerticalGrid
,
HorizontalGrid
):
pass
class
VHGrid
(
VerticalGrid
,
HorizontalGrid
):
pass
raises
(
TypeError
,
"MRO conflict among bases "
,
raises
(
TypeError
,
mro_err_msg
,
type
,
"ConfusedGrid"
,
(
HVGrid
,
VHGrid
),
{})
type
,
"ConfusedGrid"
,
(
HVGrid
,
VHGrid
),
{})
def
objects
():
def
objects
():
...
...
Objects/typeobject.c
Dosyayı görüntüle @
83245b58
...
@@ -1076,7 +1076,10 @@ set_mro_error(PyObject *to_merge, int *remain)
...
@@ -1076,7 +1076,10 @@ set_mro_error(PyObject *to_merge, int *remain)
}
}
n
=
PyDict_Size
(
set
);
n
=
PyDict_Size
(
set
);
off
=
PyOS_snprintf
(
buf
,
sizeof
(
buf
),
"MRO conflict among bases"
);
off
=
PyOS_snprintf
(
buf
,
sizeof
(
buf
),
"Cannot create class.\
The superclasses have conflicting
\n
\
inheritance trees which leave the method resolution order (MRO)
\n
\
undefined for bases"
);
i
=
0
;
i
=
0
;
while
(
PyDict_Next
(
set
,
&
i
,
&
k
,
&
v
)
&&
off
<
sizeof
(
buf
))
{
while
(
PyDict_Next
(
set
,
&
i
,
&
k
,
&
v
)
&&
off
<
sizeof
(
buf
))
{
PyObject
*
name
=
class_name
(
k
);
PyObject
*
name
=
class_name
(
k
);
...
...
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