close
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix duplicated call to importlib._install_external_importers in pylif…
…ecycle.c
  • Loading branch information
pablogsal committed Mar 29, 2018
commit 6b5518a24957bea79e4bef088a1fbc46ea6d0e5a
3 changes: 3 additions & 0 deletions Lib/test/test_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,9 @@ def check(tracebacklimit, expected):
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):
Expand Down
5 changes: 0 additions & 5 deletions Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,6 @@ initimport(PyInterpreterState *interp, PyObject *sysmod)

/* Install importlib as the implementation of import */
value = PyObject_CallMethod(importlib, "_install", "OO", sysmod, impmod);
if (value != NULL) {
Py_DECREF(value);
value = PyObject_CallMethod(importlib,
"_install_external_importers", "");
}
if (value == NULL) {
PyErr_Print();
return _Py_INIT_ERR("importlib install failed");
Expand Down