(s)
return len(s) > 0 and s[0] in _get_bothseps(s)
Test whether a path is absolute
Test whether a path is absolute
Test whether a path is absolute
def isabs(s):
    """Test whether a path is absolute"""
    s = os.fspath(s)
    # Paths beginning with \\?\ are always absolute, but do not
    # necessarily contain a drive.
    if isinstance(s, bytes):
        if s.replace(b'/', b'\\').startswith(b'\\\\?\\'):
            return True
    else:
        if s.replace('/', '\\').startswith('\\\\?\\'):
            return True
    s = splitdrive(s)[1]
    return len(s) > 0 and s[0] in _get_bothseps(s)
def isabs ( s ) : s = os . fspath ( s ) # Paths beginning with \\?\ are always absolute, but do not # necessarily contain a drive. if isinstance ( s , bytes ) : if s . replace ( b'/' , b'\\' ) . startswith ( b'\\\\?\\' ) : return True else : if s . replace ( '/' , '\\' ) . startswith ( '\\\\?\\' ) : return True s = splitdrive ( s ) [ 1 ] return len ( s ) > 0 and s [ 0 ] in _get_bothseps ( s )