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
0b5c17a9
Kaydet (Commit)
0b5c17a9
authored
Şub 11, 2008
tarafından
Nick Coghlan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Backport test_resource fix from trunk to stop it crashing on Ubuntu
üst
3e5f8a69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
test_resource.py
Lib/test/test_resource.py
+19
-14
No files found.
Lib/test/test_resource.py
Dosyayı görüntüle @
0b5c17a9
...
...
@@ -32,23 +32,28 @@ try:
except
ValueError
:
limit_set
=
0
f
=
open
(
TESTFN
,
"wb"
)
f
.
write
(
"X"
*
1024
)
f
.
flush
()
try
:
f
.
write
(
"Y"
)
f
.
flush
()
# On some systems (e.g., Ubuntu on hppa) the flush()
# doesn't always cause the exception, but the close()
# does eventually. Try flushing several times in an attempt
# to ensure the file is really synced and the exception raised.
for
i
in
range
(
5
):
time
.
sleep
(
.
1
)
f
.
write
(
"X"
*
1024
)
try
:
f
.
write
(
"Y"
)
f
.
flush
()
# On some systems (e.g., Ubuntu on hppa) the flush()
# doesn't always cause the exception, but the close()
# does eventually. Try flushing several times in
# an attempt to ensure the file is really synced and
# the exception raised.
for
i
in
range
(
5
):
time
.
sleep
(
.
1
)
f
.
flush
()
except
IOError
:
if
not
limit_set
:
raise
if
limit_set
:
# Close will attempt to flush the byte we wrote
# Restore limit first to avoid getting a spurious error
resource
.
setrlimit
(
resource
.
RLIMIT_FSIZE
,
(
cur
,
max
))
finally
:
f
.
close
()
except
IOError
:
if
not
limit_set
:
raise
f
.
close
()
finally
:
if
limit_set
:
resource
.
setrlimit
(
resource
.
RLIMIT_FSIZE
,
(
cur
,
max
))
...
...
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