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
0bffc94d
Kaydet (Commit)
0bffc94d
authored
Tem 21, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22018: signal.set_wakeup_fd() now raises an OSError instead of a
ValueError on fstat() failure.
üst
38d773bd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
test_signal.py
Lib/test/test_signal.py
+3
-3
NEWS
Misc/NEWS
+3
-0
signalmodule.c
Modules/signalmodule.c
+9
-1
No files found.
Lib/test/test_signal.py
Dosyayı görüntüle @
0bffc94d
...
@@ -252,14 +252,14 @@ class WakeupFDTests(unittest.TestCase):
...
@@ -252,14 +252,14 @@ class WakeupFDTests(unittest.TestCase):
def
test_invalid_fd
(
self
):
def
test_invalid_fd
(
self
):
fd
=
support
.
make_bad_fd
()
fd
=
support
.
make_bad_fd
()
self
.
assertRaises
(
Value
Error
,
signal
.
set_wakeup_fd
,
fd
)
self
.
assertRaises
(
OS
Error
,
signal
.
set_wakeup_fd
,
fd
)
def
test_set_wakeup_fd_result
(
self
):
def
test_set_wakeup_fd_result
(
self
):
r1
,
w1
=
os
.
pipe
()
r1
,
w1
=
os
.
pipe
()
os
.
close
(
r1
)
self
.
addCleanup
(
os
.
close
,
r1
)
self
.
addCleanup
(
os
.
close
,
w1
)
self
.
addCleanup
(
os
.
close
,
w1
)
r2
,
w2
=
os
.
pipe
()
r2
,
w2
=
os
.
pipe
()
os
.
close
(
r2
)
self
.
addCleanup
(
os
.
close
,
r2
)
self
.
addCleanup
(
os
.
close
,
w2
)
self
.
addCleanup
(
os
.
close
,
w2
)
signal
.
set_wakeup_fd
(
w1
)
signal
.
set_wakeup_fd
(
w1
)
...
...
Misc/NEWS
Dosyayı görüntüle @
0bffc94d
...
@@ -108,6 +108,9 @@ Core and Builtins
...
@@ -108,6 +108,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #22018: signal.set_wakeup_fd() now raises an OSError instead of a
ValueError on ``fstat()`` failure.
- Issue #21044: tarfile.open() now handles fileobj with an integer '
name
'
- Issue #21044: tarfile.open() now handles fileobj with an integer '
name
'
attribute. Based on patch by Martin Panter.
attribute. Based on patch by Martin Panter.
...
...
Modules/signalmodule.c
Dosyayı görüntüle @
0bffc94d
...
@@ -437,12 +437,20 @@ signal_set_wakeup_fd(PyObject *self, PyObject *args)
...
@@ -437,12 +437,20 @@ signal_set_wakeup_fd(PyObject *self, PyObject *args)
return
NULL
;
return
NULL
;
}
}
#endif
#endif
if
(
fd
!=
-
1
&&
(
!
_PyVerify_fd
(
fd
)
||
fstat
(
fd
,
&
buf
)
!=
0
))
{
if
(
fd
!=
-
1
)
{
if
(
!
_PyVerify_fd
(
fd
))
{
PyErr_SetString
(
PyExc_ValueError
,
"invalid fd"
);
PyErr_SetString
(
PyExc_ValueError
,
"invalid fd"
);
return
NULL
;
return
NULL
;
}
}
if
(
fstat
(
fd
,
&
buf
)
!=
0
)
return
PyErr_SetFromErrno
(
PyExc_OSError
);
}
old_fd
=
wakeup_fd
;
old_fd
=
wakeup_fd
;
wakeup_fd
=
fd
;
wakeup_fd
=
fd
;
return
PyLong_FromLong
(
old_fd
);
return
PyLong_FromLong
(
old_fd
);
}
}
...
...
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