mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
unicode->str.
This commit is contained in:
parent
4fbc72b4ac
commit
a0272aa6e9
2 changed files with 3 additions and 3 deletions
|
|
@ -25,11 +25,11 @@ class FixImport(basefix.BaseFix):
|
|||
def transform(self, node, results):
|
||||
imp = results['imp']
|
||||
|
||||
if unicode(imp).startswith('.'):
|
||||
if str(imp).startswith('.'):
|
||||
# Already a new-style import
|
||||
return
|
||||
|
||||
if not probably_a_local_import(unicode(imp), self.filename):
|
||||
if not probably_a_local_import(str(imp), self.filename):
|
||||
# I guess this is a global import -- skip it!
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class FixItertoolsImports(basefix.BaseFix):
|
|||
else:
|
||||
remove_comma ^= True
|
||||
|
||||
if unicode(children[-1]) == ',':
|
||||
if str(children[-1]) == ',':
|
||||
children[-1].remove()
|
||||
|
||||
# If there is nothing left, return a blank line
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue