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
556c7355
Kaydet (Commit)
556c7355
authored
Eki 31, 2010
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use addCleanup
üst
ebe5d8ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
test_io.py
Lib/test/test_io.py
+12
-12
No files found.
Lib/test/test_io.py
Dosyayı görüntüle @
556c7355
...
@@ -2541,24 +2541,24 @@ class MiscIOTest(unittest.TestCase):
...
@@ -2541,24 +2541,24 @@ class MiscIOTest(unittest.TestCase):
def
_check_warn_on_dealloc_fd
(
self
,
*
args
,
**
kwargs
):
def
_check_warn_on_dealloc_fd
(
self
,
*
args
,
**
kwargs
):
fds
=
[]
fds
=
[]
try
:
def
cleanup_fds
():
r
,
w
=
os
.
pipe
()
fds
+=
r
,
w
self
.
_check_warn_on_dealloc
(
r
,
*
args
,
**
kwargs
)
# When using closefd=False, there's no warning
r
,
w
=
os
.
pipe
()
fds
+=
r
,
w
with
warnings
.
catch_warnings
(
record
=
True
)
as
recorded
:
open
(
r
,
*
args
,
closefd
=
False
,
**
kwargs
)
support
.
gc_collect
()
self
.
assertEqual
(
recorded
,
[])
finally
:
for
fd
in
fds
:
for
fd
in
fds
:
try
:
try
:
os
.
close
(
fd
)
os
.
close
(
fd
)
except
EnvironmentError
as
e
:
except
EnvironmentError
as
e
:
if
e
.
errno
!=
errno
.
EBADF
:
if
e
.
errno
!=
errno
.
EBADF
:
raise
raise
self
.
addCleanup
(
cleanup_fds
)
r
,
w
=
os
.
pipe
()
fds
+=
r
,
w
self
.
_check_warn_on_dealloc
(
r
,
*
args
,
**
kwargs
)
# When using closefd=False, there's no warning
r
,
w
=
os
.
pipe
()
fds
+=
r
,
w
with
warnings
.
catch_warnings
(
record
=
True
)
as
recorded
:
open
(
r
,
*
args
,
closefd
=
False
,
**
kwargs
)
support
.
gc_collect
()
self
.
assertEqual
(
recorded
,
[])
def
test_warn_on_dealloc_fd
(
self
):
def
test_warn_on_dealloc_fd
(
self
):
self
.
_check_warn_on_dealloc_fd
(
"rb"
,
buffering
=
0
)
self
.
_check_warn_on_dealloc_fd
(
"rb"
,
buffering
=
0
)
...
...
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