issue #18698: ensure importlib.reload() returns the module out of sys.modules.
diff --git a/Lib/imp.py b/Lib/imp.py
index 34b6c54..30c343f 100644
--- a/Lib/imp.py
+++ b/Lib/imp.py
@@ -268,7 +268,9 @@
         if parent_name and parent_name not in sys.modules:
             msg = "parent {!r} not in sys.modules"
             raise ImportError(msg.format(parent_name), name=parent_name)
-        return module.__loader__.load_module(name)
+        module.__loader__.load_module(name)
+        # The module may have replaced itself in sys.modules!
+        return sys.modules[module.__name__]
     finally:
         try:
             del _RELOADING[name]