(path, pathext=[])
return pathsep.join(paths)
add common directories to the syspath if missing. return path
    unchanged for non-unix systems
add common directories to the syspath if missing. return path
    unchanged for non-unix systems
add common directories to the syspath if missing . return path unchanged for non - unix systems
def fix_path(path, pathext=[]):
    """add common directories to the syspath if missing. return path
    unchanged for non-unix systems"""
    OSINFO = {
        'posix': {
            'required_path': [
                '/usr/local/sbin',
                '/usr/local/bin',
                '/usr/sbin',
                '/usr/bin',
                '/sbin',
                '/bin',
            ],
            'path_sep': ':'
        }
    }

    if os.name not in OSINFO:
        return path

    pathsep = OSINFO[os.name]['path_sep']
    pathreq = OSINFO[os.name]['required_path']

    paths = [p for p in path.split(pathsep) if p]
    for rp in itertools.chain(pathext, pathreq):
        if rp not in paths:
            paths.append(rp)
    return pathsep.join(paths)
def fix_path ( path , pathext = [ ] ) : OSINFO = { 'posix' : { 'required_path' : [ '/usr/local/sbin' , '/usr/local/bin' , '/usr/sbin' , '/usr/bin' , '/sbin' , '/bin' , ] , 'path_sep' : ':' } } if os . name not in OSINFO : return path pathsep = OSINFO [ os . name ] [ 'path_sep' ] pathreq = OSINFO [ os . name ] [ 'required_path' ] paths = [ p for p in path . split ( pathsep ) if p ] for rp in itertools . chain ( pathext , pathreq ) : if rp not in paths : paths . append ( rp ) return pathsep . join ( paths )