def _build_filepath_for_phantomcss(filepath):
try:<EOL><INDENT>if os.path.exists(filepath):<EOL><INDENT>new_root = '<STR_LIT:.>'.join((os.path.splitext(filepath)[<NUM_LIT:0>], '<STR_LIT>'))<EOL>ext = os.path.splitext(filepath)[<NUM_LIT:1>]<EOL>diff_filepath = '<STR_LIT>'.join((new_root, ext))<EOL>if os.path.exists(diff_filepath):<EOL><INDENT>print('<STR_LIT>'.format(diff_filepath))<EOL>os.remove(diff_filepath)<EOL><DEDENT>return diff_filepath<EOL><DEDENT>else:<EOL><INDENT>return filepath<EOL><DEDENT><DEDENT>except OSError as e:<EOL><INDENT>print(e)<EOL><DEDENT>
Prepare screenshot filename for use with phantomcss.
        ie, append 'diff' to the end of the file if a baseline exists