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
fbacaf72
Commit
fbacaf72
authored
Oct 01, 2001
by
Skip Montanaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
approximately double dump performance by moving import of cgi.escape back to
top level.
parent
419abdaf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
Lib/xmlrpclib.py
Lib/xmlrpclib.py
+4
-6
No files found.
Lib/xmlrpclib.py
View file @
fbacaf72
...
@@ -136,6 +136,7 @@ Exported functions:
...
@@ -136,6 +136,7 @@ Exported functions:
import
re
,
string
,
time
,
operator
import
re
,
string
,
time
,
operator
from
types
import
*
from
types
import
*
from
cgi
import
escape
as
_escape
try
:
try
:
unicode
unicode
...
@@ -472,15 +473,13 @@ class Marshaller:
...
@@ -472,15 +473,13 @@ class Marshaller:
dispatch
[
FloatType
]
=
dump_double
dispatch
[
FloatType
]
=
dump_double
def
dump_string
(
self
,
value
):
def
dump_string
(
self
,
value
):
from
cgi
import
escape
self
.
write
(
"<value><string>%s</string></value>
\
n
"
%
_escape
(
value
))
self
.
write
(
"<value><string>%s</string></value>
\
n
"
%
escape
(
value
))
dispatch
[
StringType
]
=
dump_string
dispatch
[
StringType
]
=
dump_string
if
unicode
:
if
unicode
:
def
dump_unicode
(
self
,
value
):
def
dump_unicode
(
self
,
value
):
value
=
value
.
encode
(
self
.
encoding
)
value
=
value
.
encode
(
self
.
encoding
)
from
cgi
import
escape
self
.
write
(
"<value><string>%s</string></value>
\
n
"
%
_escape
(
value
))
self
.
write
(
"<value><string>%s</string></value>
\
n
"
%
escape
(
value
))
dispatch
[
UnicodeType
]
=
dump_unicode
dispatch
[
UnicodeType
]
=
dump_unicode
def
container
(
self
,
value
):
def
container
(
self
,
value
):
...
@@ -513,8 +512,7 @@ class Marshaller:
...
@@ -513,8 +512,7 @@ class Marshaller:
write
(
"<member>
\
n
"
)
write
(
"<member>
\
n
"
)
if
type
(
k
)
is
not
StringType
:
if
type
(
k
)
is
not
StringType
:
raise
TypeError
,
"dictionary key must be string"
raise
TypeError
,
"dictionary key must be string"
from
cgi
import
escape
write
(
"<name>%s</name>
\
n
"
%
_escape
(
k
))
write
(
"<name>%s</name>
\
n
"
%
escape
(
k
))
self
.
__dump
(
v
)
self
.
__dump
(
v
)
write
(
"</member>
\
n
"
)
write
(
"</member>
\
n
"
)
write
(
"</struct></value>
\
n
"
)
write
(
"</struct></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