Description
Details
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| Use raise ImportError instead of sys.exit(1) when requests is not found | pywikibot/core | master | +2 -3 |
Event Timeline
I dont mind if this sys.exit is removed (I've been getting rid of them everywhere in the library), but (for the record) the use of sys.exit if importing httplib2 failed was introduced in 2011 over in threadedhttp.py
http://git.wikimedia.org/blobdiff/pywikibot%2Fcore.git/30c2ed6f542cb3674fa989943847e2ed916e7983/pywikibot%2Fcomms%2Fthreadedhttp.py
(prior to that it only used sys.exit if import pkg_resources failed)
Removing it does mean the users are more likely to see nasty backtraces (and may not notice the nice error message that we emit) if they are not using pwb. But IMO we should only be supporting pwb and library mode.
*nod* it's even older. Let's kill it in any case -- just raising an ImportError is much more sensible.
Change 350314 had a related patch set uploaded (by Framawiki):
[pywikibot/core@master] Use raise ImportError instead of sys.exit(1) when requests is not found
Change 350314 merged by jenkins-bot:
[pywikibot/core@master] Use raise ImportError instead of sys.exit(1) when requests is not found