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
e5d2cbae
Kaydet (Commit)
e5d2cbae
authored
May 06, 2008
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Deprecate the audiodev module for 3.0.
üst
79618239
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
1 deletion
+40
-1
undoc.rst
Doc/library/undoc.rst
+2
-0
audiodev.py
Lib/audiodev.py
+3
-0
test_py3kwarn.py
Lib/test/test_py3kwarn.py
+35
-1
No files found.
Doc/library/undoc.rst
Dosyayı görüntüle @
e5d2cbae
...
...
@@ -47,6 +47,8 @@ Multimedia
:mod:`audiodev`
--- Platform-independent API for playing audio data.
.. warning:: The :mod:`audiodev` module has been removed in 3.0.
:mod:`linuxaudiodev`
--- Play audio data on the Linux audio device. Replaced in Python 2.3 by the
:mod:`ossaudiodev` module.
...
...
Lib/audiodev.py
Dosyayı görüntüle @
e5d2cbae
"""Classes for manipulating audio devices (currently only for Sun and SGI)"""
from
warnings
import
warnpy3k
warnpy3k
(
"the audiodev module has been removed in Python 3.0"
,
stacklevel
=
2
)
del
warnpy3k
__all__
=
[
"error"
,
"AudioDev"
]
...
...
Lib/test/test_py3kwarn.py
Dosyayı görüntüle @
e5d2cbae
...
...
@@ -124,8 +124,42 @@ class TestPy3KWarnings(unittest.TestCase):
self
.
assertWarning
(
buffer
(
'a'
),
w
,
expected
)
class
TestStdlibRemovals
(
unittest
.
TestCase
):
all_platforms
=
(
'audiodev'
,)
def
check_removal
(
self
,
module_name
):
"""Make sure the specified module, when imported, raises a
DeprecationWarning and specifies itself in the message."""
original_module
=
None
if
module_name
in
sys
.
modules
:
original_module
=
sys
.
modules
[
module_name
]
del
sys
.
modules
[
module_name
]
try
:
with
catch_warning
()
as
w
:
warnings
.
filterwarnings
(
"error"
,
".+ removed"
,
DeprecationWarning
)
try
:
__import__
(
module_name
,
level
=
0
)
except
DeprecationWarning
as
exc
:
self
.
assert_
(
module_name
in
exc
.
args
[
0
])
else
:
self
.
fail
(
"DeprecationWarning not raised for
%
s"
%
module_name
)
finally
:
if
original_module
:
sys
.
modules
[
module_name
]
=
original_module
def
test_platform_independent_removals
(
self
):
# Make sure that the modules that are available on all platforms raise
# the proper DeprecationWarning.
for
module_name
in
self
.
all_platforms
:
self
.
check_removal
(
module_name
)
def
test_main
():
run_unittest
(
TestPy3KWarnings
)
run_unittest
(
TestPy3KWarnings
,
TestStdlibRemovals
)
if
__name__
==
'__main__'
:
test_main
()
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