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
1eb79cfd
Kaydet (Commit)
1eb79cfd
authored
Tem 26, 2007
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Move xdrlib over to the bytes type.
üst
d24fffe7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
test_xdrlib.py
Lib/test/test_xdrlib.py
+2
-2
xdrlib.py
Lib/xdrlib.py
+5
-5
No files found.
Lib/test/test_xdrlib.py
Dosyayı görüntüle @
1eb79cfd
...
...
@@ -8,8 +8,8 @@ class XDRTest(unittest.TestCase):
def
test_xdr
(
self
):
p
=
xdrlib
.
Packer
()
s
=
'hello world'
a
=
[
'what'
,
'is'
,
'hapnin'
,
'doctor'
]
s
=
b
'hello world'
a
=
[
b
'what'
,
b
'is'
,
b
'hapnin'
,
b
'doctor'
]
p
.
pack_int
(
42
)
p
.
pack_uint
(
9
)
...
...
Lib/xdrlib.py
Dosyayı görüntüle @
1eb79cfd
...
...
@@ -5,7 +5,7 @@ See: RFC 1014
"""
import
struct
from
io
import
StringIO
as
_String
IO
from
io
import
Bytes
IO
__all__
=
[
"Error"
,
"Packer"
,
"Unpacker"
,
"ConversionError"
]
...
...
@@ -40,7 +40,7 @@ class Packer:
self
.
reset
()
def
reset
(
self
):
self
.
__buf
=
_String
IO
()
self
.
__buf
=
Bytes
IO
()
def
get_buffer
(
self
):
return
self
.
__buf
.
getvalue
()
...
...
@@ -54,8 +54,8 @@ class Packer:
pack_enum
=
pack_int
def
pack_bool
(
self
,
x
):
if
x
:
self
.
__buf
.
write
(
'
\0\0\0\1
'
)
else
:
self
.
__buf
.
write
(
'
\0\0\0\0
'
)
if
x
:
self
.
__buf
.
write
(
b
'
\0\0\0\1
'
)
else
:
self
.
__buf
.
write
(
b
'
\0\0\0\0
'
)
def
pack_uhyper
(
self
,
x
):
self
.
pack_uint
(
x
>>
32
&
0xffffffff
)
...
...
@@ -78,7 +78,7 @@ class Packer:
raise
ValueError
,
'fstring size must be nonnegative'
data
=
s
[:
n
]
n
=
((
n
+
3
)
//
4
)
*
4
data
=
data
+
(
n
-
len
(
data
))
*
'
\0
'
data
=
data
+
(
n
-
len
(
data
))
*
b
'
\0
'
self
.
__buf
.
write
(
data
)
pack_fopaque
=
pack_fstring
...
...
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