summaryrefslogtreecommitdiffstats
path: root/Lib/xmlrpclib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-02 19:09:54 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-02 19:09:54 (GMT)
commitef87d6ed94780fe00250a551031023aeb2898365 (patch)
tree1f8989aaaec7ec5f8b2f26498317f2022bf85531 /Lib/xmlrpclib.py
parent572dbf8f1320c0b34b9c786e5c30ba4a4b61b292 (diff)
downloadcpython-ef87d6ed94780fe00250a551031023aeb2898365.zip
cpython-ef87d6ed94780fe00250a551031023aeb2898365.tar.gz
cpython-ef87d6ed94780fe00250a551031023aeb2898365.tar.bz2
Rip out all the u"..." literals and calls to unicode().
Diffstat (limited to 'Lib/xmlrpclib.py')
-rw-r--r--Lib/xmlrpclib.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/xmlrpclib.py b/Lib/xmlrpclib.py
index 784b3c9..3347e54 100644
--- a/Lib/xmlrpclib.py
+++ b/Lib/xmlrpclib.py
@@ -144,9 +144,9 @@ from types import *
# Internal stuff
try:
- unicode
+ str
except NameError:
- unicode = None # unicode support not available
+ str = None # unicode support not available
try:
import datetime
@@ -160,8 +160,8 @@ except NameError:
def _decode(data, encoding, is8bit=re.compile("[\x80-\xff]").search):
# decode non-ascii string (if possible)
- if unicode and encoding and is8bit(data):
- data = unicode(data, encoding)
+ if str and encoding and is8bit(data):
+ data = str(data, encoding)
return data
def escape(s):
@@ -169,7 +169,7 @@ def escape(s):
s = s.replace("<", "&lt;")
return s.replace(">", "&gt;",)
-if unicode:
+if str:
def _stringify(string):
# convert to 7-bit ascii if possible
try:
@@ -632,7 +632,7 @@ class Marshaller:
write("</string></value>\n")
dispatch[StringType] = dump_string
- if unicode:
+ if str:
def dump_unicode(self, value, write, escape=escape):
value = value.encode(self.encoding)
write("<value><string>")
@@ -664,7 +664,7 @@ class Marshaller:
for k, v in value.items():
write("<member>\n")
if type(k) is not StringType:
- if unicode and type(k) is UnicodeType:
+ if str and type(k) is UnicodeType:
k = k.encode(self.encoding)
else:
raise TypeError, "dictionary key must be string"