diff -r b110dd3d6cea Doc/library/2to3.rst --- a/Doc/library/2to3.rst Thu Jun 02 10:20:16 2016 -0700 +++ b/Doc/library/2to3.rst Thu Jun 02 12:19:05 2016 -0700 @@ -377,7 +377,7 @@ .. 2to3fixer:: reload - Converts :func:`reload` to :func:`imp.reload`. + Converts :func:`reload` to :func:`importlib.reload`. .. 2to3fixer:: renames diff -r b110dd3d6cea Lib/lib2to3/fixes/fix_reload.py --- a/Lib/lib2to3/fixes/fix_reload.py Thu Jun 02 10:20:16 2016 -0700 +++ b/Lib/lib2to3/fixes/fix_reload.py Thu Jun 02 12:19:05 2016 -0700 @@ -1,6 +1,6 @@ """Fixer for reload(). -reload(s) -> imp.reload(s)""" +reload(s) -> importlib.reload(s)""" # Local imports from .. import fixer_base @@ -22,7 +22,7 @@ """ def transform(self, node, results): - names = ('imp', 'reload') + names = ('importlib', 'reload') new = ImportAndCall(node, results, names) - touch_import(None, 'imp', node) + touch_import(None, 'importlib', node) return new diff -r b110dd3d6cea Lib/lib2to3/tests/test_fixers.py --- a/Lib/lib2to3/tests/test_fixers.py Thu Jun 02 10:20:16 2016 -0700 +++ b/Lib/lib2to3/tests/test_fixers.py Thu Jun 02 12:19:05 2016 -0700 @@ -286,30 +286,30 @@ def test(self): b = """reload(a)""" - a = """import imp\nimp.reload(a)""" + a = """import importlib\nimportlib.reload(a)""" self.check(b, a) def test_comment(self): b = """reload( a ) # comment""" - a = """import imp\nimp.reload( a ) # comment""" + a = """import importlib\nimportlib.reload( a ) # comment""" self.check(b, a) # PEP 8 comments b = """reload( a ) # comment""" - a = """import imp\nimp.reload( a ) # comment""" + a = """import importlib\nimportlib.reload( a ) # comment""" self.check(b, a) def test_space(self): b = """reload( a )""" - a = """import imp\nimp.reload( a )""" + a = """import importlib\nimportlib.reload( a )""" self.check(b, a) b = """reload( a)""" - a = """import imp\nimp.reload( a)""" + a = """import importlib\nimportlib.reload( a)""" self.check(b, a) b = """reload(a )""" - a = """import imp\nimp.reload(a )""" + a = """import importlib\nimportlib.reload(a )""" self.check(b, a) def test_unchanged(self):