diff --git a/distutils/command/build.py b/distutils/command/build.py index 4355a63235..9606b81a46 100644 --- a/distutils/command/build.py +++ b/distutils/command/build.py @@ -81,7 +81,8 @@ def finalize_options(self): "--plat-name only supported on Windows (try " "using './configure --help' on your platform)") - plat_specifier = ".%s-%d.%d" % (self.plat_name, *sys.version_info[:2]) + plat_specifier = ".%s-%s" % (self.plat_name, + sys.implementation.cache_tag) # Make it so Python 2.x and Python 2.x with --with-pydebug don't # share the same build directories. Doing so confuses the build diff --git a/distutils/tests/test_build.py b/distutils/tests/test_build.py index 83a9e4f4dd..937244195b 100644 --- a/distutils/tests/test_build.py +++ b/distutils/tests/test_build.py @@ -24,10 +24,10 @@ def test_finalize_options(self): wanted = os.path.join(cmd.build_base, 'lib') self.assertEqual(cmd.build_purelib, wanted) - # build_platlib is 'build/lib.platform-x.x[-pydebug]' + # build_platlib is 'build/lib.platform-cache_tag[-pydebug]' # examples: - # build/lib.macosx-10.3-i386-2.7 - plat_spec = '.%s-%d.%d' % (cmd.plat_name, *sys.version_info[:2]) + # build/lib.macosx-10.3-i386-cpython39 + plat_spec = '.%s-%s' % (cmd.plat_name, sys.implementation.cache_tag) if hasattr(sys, 'gettotalrefcount'): self.assertTrue(cmd.build_platlib.endswith('-pydebug')) plat_spec += '-pydebug'