jenkins-bot merged this change.

View Change

Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
[cleanup] Simplify code in daemonize

Change-Id: I1f477b31677f06e05ed3f57e211b5a2dc3978375
---
M pywikibot/daemonize.py
1 file changed, 5 insertions(+), 6 deletions(-)

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 change 511683. To unsubscribe, or for help writing mail filters, visit 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@gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)