From 498a32a525293d32304d27138df8cb17cb894bea Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 20 Jul 2017 21:22:01 +0800 Subject: [PATCH] launcher: reword "PID exists" error --- launcher.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/launcher.py b/launcher.py index 5e000c4..121890a 100644 --- a/launcher.py +++ b/launcher.py @@ -37,14 +37,14 @@ def main(): # Write and check for an existing PID file unless specifically told not to. if not args.no_pid: - config = conf.confname - if os.path.exists("%s.pid" % config): - log.error("PID file exists; aborting! If PyLink didn't shut down cleanly last time it " - "was run, or you're upgrading from PyLink < 1.1-dev, delete %s.pid and try " - "again." % config) + pidfile = '%s.pid' % conf.confname + if os.path.exists(pidfile): + log.error("PID file exists %r; aborting! If PyLink didn't shut down cleanly last time it " + "ran, or you're upgrading from PyLink < 1.1-dev, delete %r and start the " + "server again." % (pidfile, pidfile)) sys.exit(1) - with open('%s.pid' % conf.confname, 'w') as f: + with open(pidfile, 'w') as f: f.write(str(os.getpid())) world._should_remove_pid = True