Issue #13959: Deprecate imp.get_suffixes() for new attributes on

importlib.machinery that provide the suffix details for import.
The attributes were not put on imp so as to compartmentalize
everything importlib needs for setting up imports in
importlib.machinery.

This also led to an indirect deprecation of inspect.getmoduleinfo() as
it directly returned imp.get_suffix's returned tuple which no longer
makes sense.
This commit is contained in:
Brett Cannon 2012-05-11 12:58:42 -04:00
parent 810c64df8f
commit cb66eb0dec
17 changed files with 160 additions and 69 deletions

View file

@ -1,5 +1,6 @@
"""Test case-sensitivity (PEP 235)."""
from importlib import _bootstrap
from importlib import machinery
from .. import util
from . import util as source_util
import imp
@ -20,12 +21,12 @@ class CaseSensitivityTest(unittest.TestCase):
assert name != name.lower()
def find(self, path):
finder = _bootstrap.FileFinder(path,
(_bootstrap.SourceFileLoader,
_bootstrap._SOURCE_SUFFIXES,
finder = machinery.FileFinder(path,
(machinery.SourceFileLoader,
machinery.SOURCE_SUFFIXES,
True),
(_bootstrap.SourcelessFileLoader,
[_bootstrap._BYTECODE_SUFFIX],
(machinery.SourcelessFileLoader,
machinery.BYTECODE_SUFFIXES,
True))
return finder.find_module(self.name)