bpo-33128 Fix duplicated call to importlib._install_external_importers  (GH-6273)


External importers were being added in both phases of the import
system initialisation.

They're only supposed to be added in the second phase, after the
import machinery has been appropriately configured.
(cherry picked from commit 0977091dca59709864b14cfc129388f1f0de7bf7)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 6933b41..336ae44 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -852,6 +852,9 @@
         check(-1<<1000, [traceback[-1]])
         check(None, traceback)
 
+    def test_no_duplicates_in_meta_path(self):
+        self.assertEqual(len(sys.meta_path), len(set(sys.meta_path)))
+
 
 @test.support.cpython_only
 class SizeofTest(unittest.TestCase):