mirror of
https://github.com/python/cpython.git
synced 2025-09-10 18:58:35 +00:00
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:
parent
810c64df8f
commit
cb66eb0dec
17 changed files with 160 additions and 69 deletions
|
@ -1,6 +1,6 @@
|
|||
from . import util as source_util
|
||||
|
||||
from importlib import _bootstrap
|
||||
from importlib import machinery
|
||||
import imp
|
||||
import unittest
|
||||
|
||||
|
@ -10,8 +10,8 @@ class PathHookTest(unittest.TestCase):
|
|||
"""Test the path hook for source."""
|
||||
|
||||
def path_hook(self):
|
||||
return _bootstrap.FileFinder.path_hook((_bootstrap.SourceFileLoader,
|
||||
_bootstrap._SOURCE_SUFFIXES, True))
|
||||
return machinery.FileFinder.path_hook((machinery.SourceFileLoader,
|
||||
machinery.SOURCE_SUFFIXES, True))
|
||||
|
||||
def test_success(self):
|
||||
with source_util.create_modules('dummy') as mapping:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue