supybot-botchk: Use a different method for creating pidfile if it doesn't exist

This commit is contained in:
nyuszika7h 2013-02-03 14:54:07 +01:00
parent 658d0ad84d
commit ff1d9c4f69

View File

@ -97,8 +97,8 @@ if __name__ == '__main__':
parser.error('No conffile given.') parser.error('No conffile given.')
os.chdir(options.botdir) os.chdir(options.botdir)
pidfile = open(options.pidfile, 'ab') if not os.path.exists(options.pidfile):
pidfile.close() open(options.pidfile, 'x').close()
pid = None pid = None
try: try: