Simplify various spots where: str() is called on something

that already is a string or the existence of the str class
is checked or a check is done for str twice. These all stem
from the initial unicode->str replacement.
This commit is contained in:
Walter Dörwald 2007-06-11 21:38:39 +00:00
parent 80bfb725af
commit 5de48bdd19
9 changed files with 48 additions and 89 deletions

View file

@ -246,13 +246,8 @@ class bdist_wininst (Command):
file.write(bitmapdata)
# Convert cfgdata from unicode to ascii, mbcs encoded
try:
str
except NameError:
pass
else:
if isinstance(cfgdata, str):
cfgdata = cfgdata.encode("mbcs")
if isinstance(cfgdata, str):
cfgdata = cfgdata.encode("mbcs")
# Append the pre-install script
cfgdata = cfgdata + "\0"