jayvdb added a comment.
In https://phabricator.wikimedia.org/T134336#2262524, @AbdealiJK wrote: > @jayvdb irrespective of whether this is a false positive, I think it should be changed in diff.py because of convention. > > I remember when trying to do a similar thing in https://phabricator.wikimedia.org/T123092 @Mpaa gave the gerrit comment <https://gerrit.wikimedia.org/r/#/c/277207/6/pywikibot/tools/__init__.py>: > > > This is more in line with implementation of the same kind in other modules. > > Although I do agree it would be good to have a testcase for it. (I have no idea how to test it though !) Yes, I'm 100% supporting the changes you've made, which standardise our approach to runtime detection of external packages. In https://phabricator.wikimedia.org/T134336#2262509, @jayvdb wrote: > ... > However `./pywikibot/diff.py` is a central component, and is used by the Python 3 tests, so it should be possible to create a test case that proves that the current use of `bserror` can cause an `UnboundLocalError`. Ah, the only use of `bserror` is of by `html_comparator`, which is not used anywhere and thus not covered by the tests. (and IMO we shouldnt be loading BeautifulSoup at the top of the diff module if it will never be used; it is slowing down startup) TASK DETAIL https://phabricator.wikimedia.org/T134336 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: jayvdb Cc: Mpaa, AbdealiJK, hashar, jayvdb, Aklapper, Zppix, Xqt, pywikibot-bugs-list, Mdupont _______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
