I think if ',' is *not* in project, then ``','.split(project)`` would just return ``[project]``.  You can do away with this conditional and reduce it to just one line.