Issue #17177: Stop using imp in distutils

This commit is contained in:
Brett Cannon 2013-06-15 12:59:53 -04:00
parent 7822e123c4
commit 61c3556c14
7 changed files with 26 additions and 22 deletions

View file

@ -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))