File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -409,6 +409,10 @@ def _init_posix(vars):
409409 # _sysconfigdata is generated at build time, see _generate_posix_vars()
410410 from _sysconfigdata import build_time_vars
411411 vars .update (build_time_vars )
412+ # For backward compatibility, see issue19555
413+ SO = build_time_vars .get ('EXT_SUFFIX' )
414+ if SO is not None :
415+ vars ['SO' ] = SO
412416
413417def _init_non_posix (vars ):
414418 """Initialize the module as appropriate for NT"""
@@ -579,6 +583,9 @@ def get_config_var(name):
579583
580584 Equivalent to get_config_vars().get(name)
581585 """
586+ if name == 'SO' :
587+ import warnings
588+ warnings .warn ('SO is deprecated, use EXT_SUFFIX' , DeprecationWarning )
582589 return get_config_vars ().get (name )
583590
584591
Original file line number Diff line number Diff line change @@ -369,6 +369,25 @@ def test_srcdir_independent_of_cwd(self):
369369 os .chdir (cwd )
370370 self .assertEqual (srcdir , srcdir2 )
371371
372+ @unittest .skipIf (sysconfig .get_config_var ('EXT_SUFFIX' ) is None ,
373+ 'EXT_SUFFIX required for this test' )
374+ def test_SO_deprecation (self ):
375+ self .assertWarns (DeprecationWarning ,
376+ sysconfig .get_config_var , 'SO' )
377+
378+ @unittest .skipIf (sysconfig .get_config_var ('EXT_SUFFIX' ) is None ,
379+ 'EXT_SUFFIX required for this test' )
380+ def test_SO_value (self ):
381+ self .assertEqual (sysconfig .get_config_var ('SO' ),
382+ sysconfig .get_config_var ('EXT_SUFFIX' ))
383+
384+ @unittest .skipIf (sysconfig .get_config_var ('EXT_SUFFIX' ) is None ,
385+ 'EXT_SUFFIX required for this test' )
386+ def test_SO_in_vars (self ):
387+ vars = sysconfig .get_config_vars ()
388+ self .assertIsNotNone (vars ['SO' ])
389+ self .assertEqual (vars ['SO' ], vars ['EXT_SUFFIX' ])
390+
372391
373392class MakefileTests (unittest .TestCase ):
374393
Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ Core and Builtins
5959Library
6060-------
6161
62+ - Issue #19555: Restore sysconfig.get_config_var('SO'), with a
63+ DeprecationWarning pointing people at $EXT_SUFFIX.
64+
6265- Issue #8813: Add SSLContext.verify_flags to change the verification flags
6366 of the context in order to enable certification revocation list (CRL)
6467 checks or strict X509 rules.
You can’t perform that action at this time.
0 commit comments