mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Issue #17177: Stop using imp in distutils
This commit is contained in:
parent
7822e123c4
commit
61c3556c14
7 changed files with 26 additions and 22 deletions
|
|
@ -1,7 +1,7 @@
|
|||
"""Tests for distutils.command.install_data."""
|
||||
import sys
|
||||
import os
|
||||
import imp
|
||||
import importlib.util
|
||||
import unittest
|
||||
|
||||
from distutils.command.install_lib import install_lib
|
||||
|
|
@ -44,8 +44,10 @@ class InstallLibTestCase(support.TempdirManager,
|
|||
f = os.path.join(project_dir, 'foo.py')
|
||||
self.write_file(f, '# python file')
|
||||
cmd.byte_compile([f])
|
||||
pyc_file = imp.cache_from_source('foo.py', debug_override=True)
|
||||
pyo_file = imp.cache_from_source('foo.py', debug_override=False)
|
||||
pyc_file = importlib.util.cache_from_source('foo.py',
|
||||
debug_override=True)
|
||||
pyo_file = importlib.util.cache_from_source('foo.py',
|
||||
debug_override=False)
|
||||
self.assertTrue(os.path.exists(pyc_file))
|
||||
self.assertTrue(os.path.exists(pyo_file))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue