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
03519b18
Commit
03519b18
authored
Jun 04, 2009
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove mentions of the nonexisting SlowParser in xmlrpc.client.
parent
30b0e7e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
28 deletions
+19
-28
Lib/xmlrpc/client.py
Lib/xmlrpc/client.py
+19
-28
No files found.
Lib/xmlrpc/client.py
View file @
03519b18
...
...
@@ -113,7 +113,6 @@ Exported classes:
XML-RPC value
Binary binary data wrapper
SlowParser Slow but safe standard parser (based on xmllib)
Marshaller Generate an XML-RPC params chunk from a Python data structure
Unmarshaller Unmarshal an XML-RPC response from incoming XML event message
Transport Handles an HTTP transaction to an XML-RPC server
...
...
@@ -136,6 +135,7 @@ Exported functions:
import
re
,
time
,
operator
import
http.client
from
xml.parsers
import
expat
# --------------------------------------------------------------------
# Internal stuff
...
...
@@ -439,30 +439,23 @@ WRAPPERS = (DateTime, Binary)
# --------------------------------------------------------------------
# XML parsers
try
:
from
xml.parsers
import
expat
if
not
hasattr
(
expat
,
"ParserCreate"
):
raise
ImportError
except
ImportError
:
ExpatParser
=
None
# expat not available
else
:
class
ExpatParser
:
# fast expat parser for Python 2.0 and later.
def
__init__
(
self
,
target
):
self
.
_parser
=
parser
=
expat
.
ParserCreate
(
None
,
None
)
self
.
_target
=
target
parser
.
StartElementHandler
=
target
.
start
parser
.
EndElementHandler
=
target
.
end
parser
.
CharacterDataHandler
=
target
.
data
encoding
=
None
target
.
xml
(
encoding
,
None
)
def
feed
(
self
,
data
):
self
.
_parser
.
Parse
(
data
,
0
)
def
close
(
self
):
self
.
_parser
.
Parse
(
""
,
1
)
# end of data
del
self
.
_target
,
self
.
_parser
# get rid of circular references
class
ExpatParser
:
# fast expat parser for Python 2.0 and later.
def
__init__
(
self
,
target
):
self
.
_parser
=
parser
=
expat
.
ParserCreate
(
None
,
None
)
self
.
_target
=
target
parser
.
StartElementHandler
=
target
.
start
parser
.
EndElementHandler
=
target
.
end
parser
.
CharacterDataHandler
=
target
.
data
encoding
=
None
target
.
xml
(
encoding
,
None
)
def
feed
(
self
,
data
):
self
.
_parser
.
Parse
(
data
,
0
)
def
close
(
self
):
self
.
_parser
.
Parse
(
""
,
1
)
# end of data
del
self
.
_target
,
self
.
_parser
# get rid of circular references
# --------------------------------------------------------------------
# XML-RPC marshalling and unmarshalling code
...
...
@@ -912,10 +905,8 @@ def getparser(use_datetime=0):
target
=
Unmarshaller
(
use_datetime
=
use_datetime
)
if
FastParser
:
parser
=
FastParser
(
target
)
elif
ExpatParser
:
parser
=
ExpatParser
(
target
)
else
:
parser
=
Slow
Parser
(
target
)
parser
=
Expat
Parser
(
target
)
return
parser
,
target
##
...
...
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