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)