importsysdef_pythonlib_compat():"""
On Python 3.7 and earlier, distutils would include the Python
library. See pypa/distutils#9.
"""fromdistutilsimportsysconfigifnotsysconfig.get_config_var('Py_ENABLED_SHARED'):returnyield'python{}.{}{}'.format(sys.hexversion>>24,(sys.hexversion>>16)&0xFF,sysconfig.get_config_var('ABIFLAGS'),)defcompose(f1,f2):returnlambda*args,**kwargs:f1(f2(*args,**kwargs))pythonlib=(compose(list,_pythonlib_compat)ifsys.version_info<(3,8)andsys.platform!='darwin'andsys.platform[:3]!='aix'elselist)