Fix providers.py on macOS

This commit is contained in:
jared-w 2021-10-20 11:10:56 -07:00
parent 4433f74a97
commit f5c482267c

View file

@ -507,10 +507,14 @@ class SdistDependencyProvider(DependencyProviderBase):
def conda_virtual_packages():
packages = dict(
__glibc=environ.get("MACHNIX_GLIBC_VERSION", platform.libc_ver()[0][1]),
__unix=0,
)
# platform.libc_ver() returns ('', '') on macOS and MACHNIX_GLIBC_VERSION is unset
libc_complier, libc_version = platform.libc_ver()
if libc_complier == 'glibc':
packages['__glibc'] = environ.get("MACHNIX_GLIBC_VERSION", libc_version)
# Maximum version of CUDA supported by the display driver.
cudaVer = environ.get("MACHNIX_CUDA_VERSION", None)
if cudaVer is not None: