diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py
index <HASH>..<HASH> 100644
--- a/setuptools/command/build_ext.py
+++ b/setuptools/command/build_ext.py
@@ -109,7 +109,7 @@ class build_ext(_build_ext):
                 and get_abi3_suffix()
             )
             if use_abi3:
-                so_ext = get_config_var('EXT_SUFFIX')
+                so_ext = get_config_var("EXT_SUFFIX") or get_config_var("SO")
                 filename = filename[:-len(so_ext)]
                 filename = filename + get_abi3_suffix()
             if isinstance(ext, Library):
Support Python <I> for extension suffix

In setuptools <I>+ extension building fails on Python <I> because the extension suffix is obtained using `SO` and not `EXT_SUFFIX` (which is used in <I> and above). See: <URL>