<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_slugignores(root, fname='.slugignore'):
 """ Given a root path, read any .slugignore file inside and return a list of patterns that should be removed prior to slug compilation. Return empty list if file does not exist. """

    try:
        with open(os.path.join(root, fname)) as f:
            return [l.rstrip('\n') for l in f]
    except IOError:
        return []