diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-05-09 19:44:56 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-05-09 19:44:56 (GMT) |
commit | cf7925dfc61d770c58153fd96170192e11cf8f39 (patch) | |
tree | b424709ae91cbefeb2d6e7d489a326fec948685f | |
parent | d481e3d7914d20238c62c76991255b3b2b5e4a17 (diff) | |
download | cpython-cf7925dfc61d770c58153fd96170192e11cf8f39.zip cpython-cf7925dfc61d770c58153fd96170192e11cf8f39.tar.gz cpython-cf7925dfc61d770c58153fd96170192e11cf8f39.tar.bz2 |
remove unneeded uses of str()
-rw-r--r-- | Lib/lib2to3/fixes/fix_imports.py | 2 | ||||
-rw-r--r-- | Lib/lib2to3/fixes/fix_methodattrs.py | 2 | ||||
-rw-r--r-- | Lib/lib2to3/fixes/fix_renames.py | 2 | ||||
-rw-r--r-- | Lib/lib2to3/fixes/fix_types.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/Lib/lib2to3/fixes/fix_imports.py b/Lib/lib2to3/fixes/fix_imports.py index f79ad63..46ba4a2 100644 --- a/Lib/lib2to3/fixes/fix_imports.py +++ b/Lib/lib2to3/fixes/fix_imports.py @@ -123,7 +123,7 @@ class FixImports(fixer_base.BaseFix): import_mod = results.get("module_name") if import_mod: mod_name = import_mod.value - new_name = str(self.mapping[mod_name]) + new_name = self.mapping[mod_name] import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, diff --git a/Lib/lib2to3/fixes/fix_methodattrs.py b/Lib/lib2to3/fixes/fix_methodattrs.py index 814455e..ae4096c 100644 --- a/Lib/lib2to3/fixes/fix_methodattrs.py +++ b/Lib/lib2to3/fixes/fix_methodattrs.py @@ -19,5 +19,5 @@ class FixMethodattrs(fixer_base.BaseFix): def transform(self, node, results): attr = results["attr"][0] - new = str(MAP[attr.value]) + new = MAP[attr.value] attr.replace(Name(new, prefix=attr.get_prefix())) diff --git a/Lib/lib2to3/fixes/fix_renames.py b/Lib/lib2to3/fixes/fix_renames.py index a85813f..3049610 100644 --- a/Lib/lib2to3/fixes/fix_renames.py +++ b/Lib/lib2to3/fixes/fix_renames.py @@ -65,5 +65,5 @@ class FixRenames(fixer_base.BaseFix): #import_mod = results.get("module") if mod_name and attr_name: - new_attr = str(LOOKUP[(mod_name.value, attr_name.value)]) + new_attr = LOOKUP[(mod_name.value, attr_name.value)] attr_name.replace(Name(new_attr, prefix=attr_name.get_prefix())) diff --git a/Lib/lib2to3/fixes/fix_types.py b/Lib/lib2to3/fixes/fix_types.py index 59fd011..445f1b2 100644 --- a/Lib/lib2to3/fixes/fix_types.py +++ b/Lib/lib2to3/fixes/fix_types.py @@ -56,7 +56,7 @@ class FixTypes(fixer_base.BaseFix): PATTERN = '|'.join(_pats) def transform(self, node, results): - new_value = str(_TYPE_MAPPING.get(results["name"].value)) + new_value = _TYPE_MAPPING.get(results["name"].value) if new_value: return Name(new_value, prefix=node.get_prefix()) return None |