jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/599034 )
Change subject: [IMMPR] Do not raise a RuntimeError if user-config.py is missing ......................................................................
[IMMPR] Do not raise a RuntimeError if user-config.py is missing
config2.py raises a RuntimeError if user-config.py is required but not present. This looks ugly. Especially if operators are setting up their bot they expect a pleasant hint instead of a traceback. And developers usually know about this issue and do not need the code snippet for debugging.
Change-Id: I15f7a6f356408e7113362745e81ec7758e9a01ab --- M pywikibot/config2.py 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/config2.py b/pywikibot/config2.py index d57ed60..b32710a 100644 --- a/pywikibot/config2.py +++ b/pywikibot/config2.py @@ -368,7 +368,8 @@ 'location.\n' ' Directory where user-config.py is searched is determined ' 'as follows:\n\n ') + get_base_dir.__doc__ - raise RuntimeError(exc_text) + output(exc_text) + sys.exit(1)
return base_dir
pywikibot-commits@lists.wikimedia.org