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
6d91be37
Kaydet (Commit)
6d91be37
authored
Mar 18, 2008
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
- Issue 2379: Raise a Py3K warning for __getitem__ or __getslice__ on
exception instances.
üst
0bfc8969
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
NEWS
Misc/NEWS
+3
-0
exceptions.c
Objects/exceptions.c
+12
-0
No files found.
Misc/NEWS
Dosyayı görüntüle @
6d91be37
...
...
@@ -12,6 +12,9 @@ What's New in Python 2.6 alpha 2?
Core and builtins
-----------------
- Issue 2379: Raise a Py3K warning for __getitem__ or __getslice__ on
exception instances.
- Issue #2371: Add a Py3k warning when catching an exception that
doesn't derive from BaseException. Issue #2341: Add a Py3k warning
when raising an exception that doesn't derive from BaseException.
...
...
Objects/exceptions.c
Dosyayı görüntüle @
6d91be37
...
...
@@ -189,6 +189,12 @@ static PyMethodDef BaseException_methods[] = {
static
PyObject
*
BaseException_getitem
(
PyBaseExceptionObject
*
self
,
Py_ssize_t
index
)
{
if
(
Py_Py3kWarningFlag
)
{
if
(
PyErr_Warn
(
PyExc_DeprecationWarning
,
"In 3.x, __getitem__ is not supported for exception "
"classes, use args attribute"
)
==
-
1
)
return
NULL
;
}
return
PySequence_GetItem
(
self
->
args
,
index
);
}
...
...
@@ -196,6 +202,12 @@ static PyObject *
BaseException_getslice
(
PyBaseExceptionObject
*
self
,
Py_ssize_t
start
,
Py_ssize_t
stop
)
{
if
(
Py_Py3kWarningFlag
)
{
if
(
PyErr_Warn
(
PyExc_DeprecationWarning
,
"In 3.x, __getslice__ is not supported for exception "
"classes, use args attribute"
)
==
-
1
)
return
NULL
;
}
return
PySequence_GetSlice
(
self
->
args
,
start
,
stop
);
}
...
...
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