mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	bpo-41282: Fix distutils.utils.byte_compile() DeprecationWarning (GH-25406)
* byte_compile() of distutils.utils no longer logs a DeprecationWarning * test_distutils no longer logs a DeprecationWarning
This commit is contained in:
		
							parent
							
								
									a6a5c91b1e
								
							
						
					
					
						commit
						69ca32e0d3
					
				
					 3 changed files with 17 additions and 7 deletions
				
			
		|  | @ -9,6 +9,7 @@ | |||
| import importlib.util | ||||
| import string | ||||
| import sys | ||||
| import distutils | ||||
| from distutils.errors import DistutilsPlatformError | ||||
| from distutils.dep_util import newer | ||||
| from distutils.spawn import spawn | ||||
|  | @ -419,8 +420,10 @@ def byte_compile (py_files, | |||
|              direct=1) | ||||
| """ % (optimize, force, prefix, base_dir, verbose)) | ||||
| 
 | ||||
|         msg = distutils._DEPRECATION_MESSAGE | ||||
|         cmd = [sys.executable] | ||||
|         cmd.extend(subprocess._optim_args_from_interpreter_flags()) | ||||
|         cmd.append(f'-Wignore:{msg}:DeprecationWarning') | ||||
|         cmd.append(script_name) | ||||
|         spawn(cmd, dry_run=dry_run) | ||||
|         execute(os.remove, (script_name,), "removing %s" % script_name, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner