From ff1d9c4f69bd03d8cf5f426d67c38eef94d79be2 Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Sun, 3 Feb 2013 14:54:07 +0100 Subject: [PATCH] supybot-botchk: Use a different method for creating pidfile if it doesn't exist --- scripts/supybot-botchk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/supybot-botchk b/scripts/supybot-botchk index de6e4e802..31fa7ed8a 100644 --- a/scripts/supybot-botchk +++ b/scripts/supybot-botchk @@ -97,8 +97,8 @@ if __name__ == '__main__': parser.error('No conffile given.') os.chdir(options.botdir) - pidfile = open(options.pidfile, 'ab') - pidfile.close() + if not os.path.exists(options.pidfile): + open(options.pidfile, 'x').close() pid = None try: