def delete_if_exists(pathname):
 try:
  os.unlink(pathname)
 except OSError as e:
  if (e.errno == errno.ENOENT):
   return
  else:
   raise

def delete_if_exists ( pathname ) : try : os . unlink ( pathname ) except OSError as e : if ( e . errno == errno . ENOENT ) : return else : raise
delete a file .