Issue #13959: Re-implement imp.get_suffixes() in Lib/imp.py.

This introduces a new function, imp.extension_suffixes(), which is
currently undocumented. That is forthcoming once issue #14657 is
resolved and how to expose file suffixes is decided.
diff --git a/Lib/imp.py b/Lib/imp.py
index 8f67200..3116347 100644
--- a/Lib/imp.py
+++ b/Lib/imp.py
@@ -9,11 +9,9 @@
 from _imp import (lock_held, acquire_lock, release_lock,
                   load_dynamic, get_frozen_object, is_frozen_package,
                   init_builtin, init_frozen, is_builtin, is_frozen,
-                  _fix_co_filename)
+                  _fix_co_filename, extension_suffixes)
 # Could move out of _imp, but not worth the code
 from _imp import get_magic, get_tag
-# Can (probably) move to importlib
-from _imp import get_suffixes
 
 from importlib._bootstrap import new_module
 from importlib._bootstrap import cache_from_source
@@ -38,6 +36,14 @@
 IMP_HOOK = 9
 
 
+def get_suffixes():
+    extensions = [(s, 'rb', C_EXTENSION) for s in extension_suffixes()]
+    source = [(s, 'U', PY_SOURCE) for s in _bootstrap._SOURCE_SUFFIXES]
+    bytecode = [(_bootstrap._BYTECODE_SUFFIX, 'rb', PY_COMPILED)]
+
+    return extensions + source + bytecode
+
+
 def source_from_cache(path):
     """Given the path to a .pyc./.pyo file, return the path to its .py file.
 
@@ -120,8 +126,8 @@
 # XXX deprecate
 def load_package(name, path):
     if os.path.isdir(path):
-        extensions = _bootstrap._suffix_list(PY_SOURCE)
-        extensions += _bootstrap._suffix_list(PY_COMPILED)
+        extensions = _bootstrap._SOURCE_SUFFIXES
+        extensions += [_bootstrap._BYTECODE_SUFFIX]
         for extension in extensions:
             path = os.path.join(path, '__init__'+extension)
             if os.path.exists(path):