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
7a5dc755
Kaydet (Commit)
7a5dc755
authored
Agu 17, 2008
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#3567: fix sunau for running with -bb and make test_ossaudiodev work.
üst
47d305d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
sunau.py
Lib/sunau.py
+5
-6
test_ossaudiodev.py
Lib/test/test_ossaudiodev.py
+3
-3
No files found.
Lib/sunau.py
Dosyayı görüntüle @
7a5dc755
...
...
@@ -135,7 +135,7 @@ def _read_u32(file):
x
=
0
for
i
in
range
(
4
):
byte
=
file
.
read
(
1
)
if
byte
==
''
:
if
not
byte
:
raise
EOFError
x
=
x
*
256
+
ord
(
byte
)
return
x
...
...
@@ -144,10 +144,9 @@ def _write_u32(file, x):
data
=
[]
for
i
in
range
(
4
):
d
,
m
=
divmod
(
x
,
256
)
data
.
insert
(
0
,
m
)
data
.
insert
(
0
,
int
(
m
)
)
x
=
d
for
i
in
range
(
4
):
file
.
write
(
chr
(
int
(
data
[
i
])))
file
.
write
(
bytes
(
data
))
class
Au_read
:
...
...
@@ -198,7 +197,7 @@ class Au_read:
if
self
.
_hdr_size
>
24
:
self
.
_info
=
file
.
read
(
self
.
_hdr_size
-
24
)
for
i
in
range
(
len
(
self
.
_info
)):
if
self
.
_info
[
i
]
==
'
\0
'
:
if
self
.
_info
[
i
]
==
b
'
\0
'
:
self
.
_info
=
self
.
_info
[:
i
]
break
else
:
...
...
@@ -451,7 +450,7 @@ class Au_write:
_write_u32
(
self
.
_file
,
self
.
_framerate
)
_write_u32
(
self
.
_file
,
self
.
_nchannels
)
self
.
_file
.
write
(
self
.
_info
)
self
.
_file
.
write
(
'
\0
'
*
(
header_size
-
len
(
self
.
_info
)
-
24
))
self
.
_file
.
write
(
b
'
\0
'
*
(
header_size
-
len
(
self
.
_info
)
-
24
))
def
_patchheader
(
self
):
self
.
_file
.
seek
(
8
)
...
...
Lib/test/test_ossaudiodev.py
Dosyayı görüntüle @
7a5dc755
...
...
@@ -57,7 +57,7 @@ class OSSAudioDevTests(unittest.TestCase):
dsp
.
fileno
()
# Make sure the read-only attributes work.
self
.
fail
Unless
(
dsp
.
close
)
self
.
fail
If
(
dsp
.
closed
)
self
.
assertEqual
(
dsp
.
name
,
"/dev/dsp"
)
self
.
assertEqual
(
dsp
.
mode
,
"w"
,
"bad dsp.mode:
%
r"
%
dsp
.
mode
)
...
...
@@ -65,7 +65,7 @@ class OSSAudioDevTests(unittest.TestCase):
for
attr
in
(
'closed'
,
'name'
,
'mode'
):
try
:
setattr
(
dsp
,
attr
,
42
)
except
TypeError
:
except
(
TypeError
,
AttributeError
)
:
pass
else
:
self
.
fail
(
"dsp.
%
s not read-only"
%
attr
)
...
...
@@ -75,7 +75,7 @@ class OSSAudioDevTests(unittest.TestCase):
# set parameters based on .au file headers
dsp
.
setparameters
(
AFMT_S16_NE
,
nchannels
,
rate
)
self
.
assert
Equals
(
"
%.2
f"
%
expected_time
,
"2.93"
)
self
.
assert
True
(
abs
(
expected_time
-
2.94
)
<
1e-2
,
expected_time
)
t1
=
time
.
time
()
dsp
.
write
(
data
)
dsp
.
close
()
...
...
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