jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1061098?usp=email )
Change subject: [IMPR] Add a hint to import missing module in wrapper.py
......................................................................
[IMPR] Add a hint to import missing module in wrapper.py
Change-Id: I4286cd234be63787a7988d9152a940f3bfdf070e
---
M pywikibot/scripts/wrapper.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/scripts/wrapper.py b/pywikibot/scripts/wrapper.py
index 71e7a0b..bba3591 100755
--- a/pywikibot/scripts/wrapper.py
+++ b/pywikibot/scripts/wrapper.py
@@ -314,8 +314,10 @@
# we need to re-start the entire process. Ask the user to do so.
print('Now, you have to re-execute the command to start your script.')
sys.exit(1)
-except ImportError as e: # raised in textlib or backports
- sys.exit(e)
+except ModuleNotFoundError as module: # raised in textlib or backports
+ print(f'\n{module.msg}\nPlease install it with\n\n'
+ f' pip install {module.name}')
+ sys.exit()
def find_alternates(filename, script_paths):
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1061098?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I4286cd234be63787a7988d9152a940f3bfdf070e
Gerrit-Change-Number: 1061098
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]