mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
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:
parent
80bfb725af
commit
5de48bdd19
9 changed files with 48 additions and 89 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue