summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/IOBinding.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/idlelib/IOBinding.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/idlelib/IOBinding.py')
-rw-r--r--Lib/idlelib/IOBinding.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index b433c9b..006e94b 100644
--- a/Lib/idlelib/IOBinding.py
+++ b/Lib/idlelib/IOBinding.py
@@ -255,7 +255,7 @@ class IOBinding:
firsteol = self.eol_re.search(chars)
if firsteol:
self.eol_convention = firsteol.group(0)
- if isinstance(self.eol_convention, unicode):
+ if isinstance(self.eol_convention, str):
# Make sure it is an ASCII string
self.eol_convention = self.eol_convention.encode("ascii")
chars = self.eol_re.sub(r"\n", chars)
@@ -298,18 +298,18 @@ class IOBinding:
enc = None
if enc:
try:
- return unicode(chars, enc)
+ return str(chars, enc)
except UnicodeError:
pass
# If it is ASCII, we need not to record anything
try:
- return unicode(chars, 'ascii')
+ return str(chars, 'ascii')
except UnicodeError:
pass
# Finally, try the locale's encoding. This is deprecated;
# the user should declare a non-ASCII encoding
try:
- chars = unicode(chars, encoding)
+ chars = str(chars, encoding)
self.fileencoding = encoding
except UnicodeError:
pass
@@ -522,7 +522,7 @@ class IOBinding:
self.opendialog = tkFileDialog.Open(master=self.text,
filetypes=self.filetypes)
filename = self.opendialog.show(initialdir=dir, initialfile=base)
- if isinstance(filename, unicode):
+ if isinstance(filename, str):
filename = filename.encode(filesystemencoding)
return filename
@@ -544,7 +544,7 @@ class IOBinding:
self.savedialog = tkFileDialog.SaveAs(master=self.text,
filetypes=self.filetypes)
filename = self.savedialog.show(initialdir=dir, initialfile=base)
- if isinstance(filename, unicode):
+ if isinstance(filename, str):
filename = filename.encode(filesystemencoding)
return filename