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
dcde4941
Kaydet (Commit)
dcde4941
authored
Agu 29, 2008
tarafından
Armin Rigo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
A collection of crashers, all variants of the idea
of issue #3720.
üst
d4ae97bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
iter.py
Lib/test/crashers/iter.py
+53
-0
No files found.
Lib/test/crashers/iter.py
0 → 100644
Dosyayı görüntüle @
dcde4941
# Calls to PyIter_Next, or direct calls to tp_iternext, on an object
# which might no longer be an iterable because its 'next' method was
# removed. These are all variants of Issue3720.
"""
Run this script with an argument between 1 and <N> to test for
different crashes.
"""
N
=
8
import
sys
class
Foo
(
object
):
def
__iter__
(
self
):
return
self
def
next
(
self
):
del
Foo
.
next
return
(
1
,
2
)
def
case1
():
list
(
enumerate
(
Foo
()))
def
case2
():
x
,
y
=
Foo
()
def
case3
():
filter
(
None
,
Foo
())
def
case4
():
map
(
None
,
Foo
(),
Foo
())
def
case5
():
max
(
Foo
())
def
case6
():
sum
(
Foo
(),
())
def
case7
():
dict
(
Foo
())
def
case8
():
sys
.
stdout
.
writelines
(
Foo
())
# etc...
if
__name__
==
'__main__'
:
if
len
(
sys
.
argv
)
<
2
:
print
__doc__
.
replace
(
'<N>'
,
str
(
N
))
else
:
n
=
int
(
sys
.
argv
[
1
])
func
=
globals
()[
'case
%
d'
%
n
]
func
()
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