parameters: (is_python_ext=False)
return_statement: return so_ext
docstring: Return the correct file extension for shared libraries.
  
      Parameters
      ----------
      is_python_ext : bool, optional
          Whether the shared library is a Python extension.  Default is False.
  
      Returns
      -------
      so_ext : str
          The shared library extension.
  
      Notes
      -----
      For Python shared libs, `so_ext` will typically be '.so' on Linux and OS X,
      and '.pyd' on Windows.  For Python >= 3.2 `so_ext` has a tag prepended on
      POSIX systems according to PEP 3149.  For Python 3.2 this is implemented on
      Linux, but not on OS X.
docstring_summary: Return the correct file extension for shared libraries.
docstring_tokens: Return the correct file extension for shared libraries .
function: def get_shared_lib_extension(is_python_ext=False):
      """Return the correct file extension for shared libraries.
  
      Parameters
      ----------
      is_python_ext : bool, optional
          Whether the shared library is a Python extension.  Default is False.
  
      Returns
      -------
      so_ext : str
          The shared library extension.
  
      Notes
      -----
      For Python shared libs, `so_ext` will typically be '.so' on Linux and OS X,
      and '.pyd' on Windows.  For Python >= 3.2 `so_ext` has a tag prepended on
      POSIX systems according to PEP 3149.  For Python 3.2 this is implemented on
      Linux, but not on OS X.
  
      """
      confvars = distutils.sysconfig.get_config_vars()
      # SO is deprecated in 3.3.1, use EXT_SUFFIX instead
      so_ext = confvars.get('EXT_SUFFIX', None)
      if so_ext is None:
          so_ext = confvars.get('SO', '')
  
      if not is_python_ext:
          # hardcode known values, config vars (including SHLIB_SUFFIX) are
          # unreliable (see #3182)
          # darwin, windows and debug linux are wrong in 3.3.1 and older
          if (sys.platform.startswith('linux') or
              sys.platform.startswith('gnukfreebsd')):
              so_ext = '.so'
          elif sys.platform.startswith('darwin'):
              so_ext = '.dylib'
          elif sys.platform.startswith('win'):
              so_ext = '.dll'
          else:
              # fall back to config vars for unknown platforms
              # fix long extension for Python >=3.2, see PEP 3149.
              if 'SOABI' in confvars:
                  # Does nothing unless SOABI config var exists
                  so_ext = so_ext.replace('.' + confvars.get('SOABI'), '', 1)
  
      return so_ext
function_tokens: def get_shared_lib_extension ( is_python_ext = False ) : confvars = distutils . sysconfig . get_config_vars ( ) # SO is deprecated in 3.3.1, use EXT_SUFFIX instead so_ext = confvars . get ( 'EXT_SUFFIX' , None ) if so_ext is None : so_ext = confvars . get ( 'SO' , '' ) if not is_python_ext : # hardcode known values, config vars (including SHLIB_SUFFIX) are # unreliable (see #3182) # darwin, windows and debug linux are wrong in 3.3.1 and older if ( sys . platform . startswith ( 'linux' ) or sys . platform . startswith ( 'gnukfreebsd' ) ) : so_ext = '.so' elif sys . platform . startswith ( 'darwin' ) : so_ext = '.dylib' elif sys . platform . startswith ( 'win' ) : so_ext = '.dll' else : # fall back to config vars for unknown platforms # fix long extension for Python >=3.2, see PEP 3149. if 'SOABI' in confvars : # Does nothing unless SOABI config var exists so_ext = so_ext . replace ( '.' + confvars . get ( 'SOABI' ) , '' , 1 ) return so_ext