mirror of
				https://github.com/python/cpython.git
				synced 2025-11-01 06:01:29 +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
				
			
		|  | @ -2,7 +2,6 @@ | |||
| 
 | ||||
| import os | ||||
| import sys | ||||
| import imp | ||||
| import unittest | ||||
| 
 | ||||
| from distutils.command.build_py import build_py | ||||
|  | @ -63,7 +62,8 @@ def test_package_data(self): | |||
|             self.assertFalse(os.path.exists(pycache_dir)) | ||||
|         else: | ||||
|             pyc_files = os.listdir(pycache_dir) | ||||
|             self.assertIn("__init__.%s.pyc" % imp.get_tag(), pyc_files) | ||||
|             self.assertIn("__init__.%s.pyc" % sys.implementation.cache_tag, | ||||
|                           pyc_files) | ||||
| 
 | ||||
|     def test_empty_package_dir(self): | ||||
|         # See bugs #1668596/#1720897 | ||||
|  | @ -102,7 +102,8 @@ def test_byte_compile(self): | |||
|         found = os.listdir(cmd.build_lib) | ||||
|         self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py']) | ||||
|         found = os.listdir(os.path.join(cmd.build_lib, '__pycache__')) | ||||
|         self.assertEqual(found, ['boiledeggs.%s.pyc' % imp.get_tag()]) | ||||
|         self.assertEqual(found, | ||||
|                          ['boiledeggs.%s.pyc' % sys.implementation.cache_tag]) | ||||
| 
 | ||||
|     @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled') | ||||
|     def test_byte_compile_optimized(self): | ||||
|  | @ -119,7 +120,8 @@ def test_byte_compile_optimized(self): | |||
|         found = os.listdir(cmd.build_lib) | ||||
|         self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py']) | ||||
|         found = os.listdir(os.path.join(cmd.build_lib, '__pycache__')) | ||||
|         self.assertEqual(sorted(found), ['boiledeggs.%s.pyo' % imp.get_tag()]) | ||||
|         self.assertEqual(sorted(found), | ||||
|                          ['boiledeggs.%s.pyo' % sys.implementation.cache_tag]) | ||||
| 
 | ||||
|     def test_dont_write_bytecode(self): | ||||
|         # makes sure byte_compile is not used | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Brett Cannon
						Brett Cannon