You could use EEXIST from the errno module instead.