jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/511683 )
Change subject: [cleanup] Simplify code in daemonize
......................................................................
[cleanup] Simplify code in daemonize
Change-Id: I1f477b31677f06e05ed3f57e211b5a2dc3978375
---
M pywikibot/daemonize.py
1 file changed, 5 insertions(+), 6 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/daemonize.py b/pywikibot/daemonize.py
index 7fe1c04..d7ceea1 100644
--- a/pywikibot/daemonize.py
+++ b/pywikibot/daemonize.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Module to daemonize the current process on Unix."""
#
-# (C) Pywikibot team, 2007-2018
+# (C) Pywikibot team, 2007-2019
#
# Distributed under the terms of the MIT license.
#
@@ -55,13 +55,12 @@
os.dup2(1, 2)
if chdir:
os.chdir('/')
+ return
else:
# Write out the pid
path = os.path.basename(sys.argv[0]) + '.pid'
with codecs.open(path, 'w', 'utf-8') as f:
f.write(str(pid))
- os._exit(0)
- else:
- # Exit to return control to the terminal
- # os._exit to prevent the cleanup to run
- os._exit(0)
+ # Exit to return control to the terminal
+ # os._exit to prevent the cleanup to run
+ os._exit(0)
--
To view, visit
https://gerrit.wikimedia.org/r/511683
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1f477b31677f06e05ed3f57e211b5a2dc3978375
Gerrit-Change-Number: 511683
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)