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
283a1353
Kaydet (Commit)
283a1353
authored
Kas 19, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch [ 1586791 ] better error msgs for some TypeErrors
üst
db4f255c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
16 deletions
+27
-16
test_format.py
Lib/test/test_format.py
+2
-2
NEWS
Misc/NEWS
+3
-0
listobject.c
Objects/listobject.c
+9
-6
stringobject.c
Objects/stringobject.c
+10
-6
tupleobject.c
Objects/tupleobject.c
+3
-2
No files found.
Lib/test/test_format.py
Dosyayı görüntüle @
283a1353
...
@@ -219,8 +219,8 @@ if have_unicode:
...
@@ -219,8 +219,8 @@ if have_unicode:
test_exc
(
unicode
(
'abc
%
\u3000
'
,
'raw-unicode-escape'
),
1
,
ValueError
,
test_exc
(
unicode
(
'abc
%
\u3000
'
,
'raw-unicode-escape'
),
1
,
ValueError
,
"unsupported format character '?' (0x3000) at index 5"
)
"unsupported format character '?' (0x3000) at index 5"
)
test_exc
(
'
%
d'
,
'1'
,
TypeError
,
"int argument required"
)
test_exc
(
'
%
d'
,
'1'
,
TypeError
,
"int argument required
, not str
"
)
test_exc
(
'
%
g'
,
'1'
,
TypeError
,
"float argument required"
)
test_exc
(
'
%
g'
,
'1'
,
TypeError
,
"float argument required
, not str
"
)
test_exc
(
'no format'
,
'1'
,
TypeError
,
test_exc
(
'no format'
,
'1'
,
TypeError
,
"not all arguments converted during string formatting"
)
"not all arguments converted during string formatting"
)
test_exc
(
'no format'
,
u'1'
,
TypeError
,
test_exc
(
'no format'
,
u'1'
,
TypeError
,
...
...
Misc/NEWS
Dosyayı görüntüle @
283a1353
...
@@ -12,6 +12,9 @@ What's New in Python 2.6 alpha 1?
...
@@ -12,6 +12,9 @@ What's New in Python 2.6 alpha 1?
Core and builtins
Core and builtins
-----------------
-----------------
- Patch #1586791: Better exception messages for some operations on strings,
tuples and lists.
- Bug #1067760: Deprecate passing floats to file.seek.
- Bug #1067760: Deprecate passing floats to file.seek.
- Bug #1591996: Correctly forward exception in instance_contains().
- Bug #1591996: Correctly forward exception in instance_contains().
...
...
Objects/listobject.c
Dosyayı görüntüle @
283a1353
...
@@ -946,9 +946,10 @@ islt(PyObject *x, PyObject *y, PyObject *compare)
...
@@ -946,9 +946,10 @@ islt(PyObject *x, PyObject *y, PyObject *compare)
if
(
res
==
NULL
)
if
(
res
==
NULL
)
return
-
1
;
return
-
1
;
if
(
!
PyInt_Check
(
res
))
{
if
(
!
PyInt_Check
(
res
))
{
PyErr_Format
(
PyExc_TypeError
,
"comparison function must return int, not %.200s"
,
res
->
ob_type
->
tp_name
);
Py_DECREF
(
res
);
Py_DECREF
(
res
);
PyErr_SetString
(
PyExc_TypeError
,
"comparison function must return int"
);
return
-
1
;
return
-
1
;
}
}
i
=
PyInt_AsLong
(
res
);
i
=
PyInt_AsLong
(
res
);
...
@@ -2491,8 +2492,9 @@ list_subscript(PyListObject* self, PyObject* item)
...
@@ -2491,8 +2492,9 @@ list_subscript(PyListObject* self, PyObject* item)
}
}
}
}
else
{
else
{
PyErr_SetString
(
PyExc_TypeError
,
PyErr_Format
(
PyExc_TypeError
,
"list indices must be integers"
);
"list indices must be integers, not %.200s"
,
item
->
ob_type
->
tp_name
);
return
NULL
;
return
NULL
;
}
}
}
}
...
@@ -2635,8 +2637,9 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
...
@@ -2635,8 +2637,9 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
}
}
}
}
else
{
else
{
PyErr_SetString
(
PyExc_TypeError
,
PyErr_Format
(
PyExc_TypeError
,
"list indices must be integers"
);
"list indices must be integers, not %.200s"
,
item
->
ob_type
->
tp_name
);
return
-
1
;
return
-
1
;
}
}
}
}
...
...
Objects/stringobject.c
Dosyayı görüntüle @
283a1353
...
@@ -1071,8 +1071,9 @@ string_contains(PyObject *str_obj, PyObject *sub_obj)
...
@@ -1071,8 +1071,9 @@ string_contains(PyObject *str_obj, PyObject *sub_obj)
return
PyUnicode_Contains
(
str_obj
,
sub_obj
);
return
PyUnicode_Contains
(
str_obj
,
sub_obj
);
#endif
#endif
if
(
!
PyString_Check
(
sub_obj
))
{
if
(
!
PyString_Check
(
sub_obj
))
{
PyErr_SetString
(
PyExc_TypeError
,
PyErr_Format
(
PyExc_TypeError
,
"'in <string>' requires string as left operand"
);
"'in <string>' requires string as left operand, "
"not %.200s"
,
sub_obj
->
ob_type
->
tp_name
);
return
-
1
;
return
-
1
;
}
}
}
}
...
@@ -1240,8 +1241,9 @@ string_subscript(PyStringObject* self, PyObject* item)
...
@@ -1240,8 +1241,9 @@ string_subscript(PyStringObject* self, PyObject* item)
}
}
}
}
else
{
else
{
PyErr_SetString
(
PyExc_TypeError
,
PyErr_Format
(
PyExc_TypeError
,
"string indices must be integers"
);
"string indices must be integers, not %.200s"
,
item
->
ob_type
->
tp_name
);
return
NULL
;
return
NULL
;
}
}
}
}
...
@@ -4148,7 +4150,8 @@ formatfloat(char *buf, size_t buflen, int flags,
...
@@ -4148,7 +4150,8 @@ formatfloat(char *buf, size_t buflen, int flags,
double
x
;
double
x
;
x
=
PyFloat_AsDouble
(
v
);
x
=
PyFloat_AsDouble
(
v
);
if
(
x
==
-
1
.
0
&&
PyErr_Occurred
())
{
if
(
x
==
-
1
.
0
&&
PyErr_Occurred
())
{
PyErr_SetString
(
PyExc_TypeError
,
"float argument required"
);
PyErr_Format
(
PyExc_TypeError
,
"float argument required, "
"not %.200s"
,
v
->
ob_type
->
tp_name
);
return
-
1
;
return
-
1
;
}
}
if
(
prec
<
0
)
if
(
prec
<
0
)
...
@@ -4343,7 +4346,8 @@ formatint(char *buf, size_t buflen, int flags,
...
@@ -4343,7 +4346,8 @@ formatint(char *buf, size_t buflen, int flags,
x
=
PyInt_AsLong
(
v
);
x
=
PyInt_AsLong
(
v
);
if
(
x
==
-
1
&&
PyErr_Occurred
())
{
if
(
x
==
-
1
&&
PyErr_Occurred
())
{
PyErr_SetString
(
PyExc_TypeError
,
"int argument required"
);
PyErr_Format
(
PyExc_TypeError
,
"int argument required, not %.200s"
,
v
->
ob_type
->
tp_name
);
return
-
1
;
return
-
1
;
}
}
if
(
x
<
0
&&
type
==
'u'
)
{
if
(
x
<
0
&&
type
==
'u'
)
{
...
...
Objects/tupleobject.c
Dosyayı görüntüle @
283a1353
...
@@ -620,8 +620,9 @@ tuplesubscript(PyTupleObject* self, PyObject* item)
...
@@ -620,8 +620,9 @@ tuplesubscript(PyTupleObject* self, PyObject* item)
}
}
}
}
else
{
else
{
PyErr_SetString
(
PyExc_TypeError
,
PyErr_Format
(
PyExc_TypeError
,
"tuple indices must be integers"
);
"tuple indices must be integers, not %.200s"
,
item
->
ob_type
->
tp_name
);
return
NULL
;
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