parameters: ()
return_statement: return version
docstring: Primary implementation of glibc_version_string using os.confstr.
docstring_summary: Primary implementation of glibc_version_string using os.confstr.
docstring_tokens: Primary implementation of glibc_version_string using os . confstr .
function: def _glibc_version_string_confstr() -> Optional[str]:
      """
      Primary implementation of glibc_version_string using os.confstr.
      """
      # os.confstr is quite a bit faster than ctypes.DLL. It's also less likely
      # to be broken or missing. This strategy is used in the standard library
      # platform module.
      # https://github.com/python/cpython/blob/fcf1d003bf4f0100c/Lib/platform.py#L175-L183
      try:
          # os.confstr("CS_GNU_LIBC_VERSION") returns a string like "glibc 2.17".
          version_string = os.confstr("CS_GNU_LIBC_VERSION")
          assert version_string is not None
          _, version = version_string.split()
      except (AssertionError, AttributeError, OSError, ValueError):
          # os.confstr() or CS_GNU_LIBC_VERSION not available (or a bad value)...
          return None
      return version
function_tokens: def _glibc_version_string_confstr ( ) -> Optional [ str ] : # os.confstr is quite a bit faster than ctypes.DLL. It's also less likely # to be broken or missing. This strategy is used in the standard library # platform module. # https://github.com/python/cpython/blob/fcf1d003bf4f0100c/Lib/platform.py#L175-L183 try : # os.confstr("CS_GNU_LIBC_VERSION") returns a string like "glibc 2.17". version_string = os . confstr ( "CS_GNU_LIBC_VERSION" ) assert version_string is not None _ , version = version_string . split ( ) except ( AssertionError , AttributeError , OSError , ValueError ) : # os.confstr() or CS_GNU_LIBC_VERSION not available (or a bad value)... return None return version