mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue 19944: Fix importlib.find_spec() so it imports parents as needed.
The function is also moved to importlib.util.
This commit is contained in:
parent
128ee220e2
commit
6029e08691
11 changed files with 292 additions and 230 deletions
|
@ -611,7 +611,7 @@ def get_data(package, resource):
|
|||
which does not support get_data(), then None is returned.
|
||||
"""
|
||||
|
||||
spec = importlib.find_spec(package)
|
||||
spec = importlib.util.find_spec(package)
|
||||
if spec is None:
|
||||
return None
|
||||
loader = spec.loader
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue