tools/refguide_check.py
def short_path(path, cwd=None):
    """
    Return relative or absolute path name, whichever is shortest.
    """
    if not isinstance(path, str):
        return path
    if cwd is None:
        cwd = os.getcwd()
    abspath = os.path.abspath(path)
    relpath = os.path.relpath(path, cwd)
    if len(abspath) <= len(relpath):
        return abspath
    return relpath

    Return relative or absolute path name, whichever is shortest.
    
Return relative or absolute path name, whichever is shortest.
Return relative or absolute path name whichever is shortest .
def short_path(path, cwd=None):
    if not isinstance(path, str):
        return path
    if cwd is None:
        cwd = os.getcwd()
    abspath = os.path.abspath(path)
    relpath = os.path.relpath(path, cwd)
    if len(abspath) <= len(relpath):
        return abspath
    return relpath
def short_path ( path , cwd = None ) : if not isinstance ( path , str ) : return path if cwd is None : cwd = os . getcwd ( ) abspath = os . path . abspath ( path ) relpath = os . path . relpath ( path , cwd ) if len ( abspath ) <= len ( relpath ) : return abspath return relpath
Return relative or absolute path name, whichever is shortest.
Return relative or absolute path name whichever is shortest .
"""
    Return relative or absolute path name, whichever is shortest.
    """
path
cwd