def __enter__(self):
self.pidfile = open(self.path, '<STR_LIT>')<EOL>try:<EOL><INDENT>fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)<EOL><DEDENT>except IOError:<EOL><INDENT>raise SystemExit('<STR_LIT>'.format(self.path))<EOL><DEDENT>self.pidfile.seek(<NUM_LIT:0>)<EOL>self.pidfile.truncate()<EOL>self.pidfile.write(str(os.getpid()))<EOL>self.pidfile.flush()<EOL>self.pidfile.seek(<NUM_LIT:0>)<EOL>return self.pidfile<EOL>
Writes the pid of the current process to the path