Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7b729d88
Commit
7b729d88
authored
Apr 24, 2003
by
Skip Montanaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move imports in Binary class to top level to avoid repeated imports.
use cStringIO if available.
parent
771de159
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Lib/xmlrpclib.py
Lib/xmlrpclib.py
+6
-2
No files found.
Lib/xmlrpclib.py
View file @
7b729d88
...
...
@@ -386,6 +386,12 @@ def _datetime(data):
#
# @param data An 8-bit string containing arbitrary data.
import
base64
try
:
import
cStringIO
as
StringIO
except
ImportError
:
import
StringIO
class
Binary
:
"""Wrapper for binary data."""
...
...
@@ -406,11 +412,9 @@ class Binary:
return
cmp
(
self
.
data
,
other
)
def
decode
(
self
,
data
):
import
base64
self
.
data
=
base64
.
decodestring
(
data
)
def
encode
(
self
,
out
):
import
base64
,
StringIO
out
.
write
(
"<value><base64>
\
n
"
)
base64
.
encode
(
StringIO
.
StringIO
(
self
.
data
),
out
)
out
.
write
(
"</base64></value>
\
n
"
)
...
...
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