def islink(path):
try:<EOL><INDENT>st = os.lstat(path)<EOL><DEDENT>except (os.error, AttributeError):<EOL><INDENT>return False<EOL><DEDENT>return stat.S_ISLNK(st.st_mode)<EOL>
Test whether a path is a symbolic link