jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/479517 )
Change subject: [cleanup] pywikibot/site.py: simplify test ......................................................................
[cleanup] pywikibot/site.py: simplify test
The form using a tuple, isinstance(x, (A, B, ...)), is a shortcut for isinstance(x, A) or isinstance(x, B) or ... (etc.).
Change-Id: I8ffa9da4f37b8851801e404e0c47ca6774dff828 --- M pywikibot/site.py 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index 0de4971..ea0b4a3 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -5814,9 +5814,9 @@ if all(_ is None for _ in [rcid, revid, revision]): raise Error('No rcid, revid or revision provided.')
- if isinstance(rcid, int) or isinstance(rcid, basestring): + if isinstance(rcid, (int, basestring)): rcid = {rcid} - if isinstance(revid, int) or isinstance(revid, basestring): + if isinstance(revid, (int, basestring)): revid = {revid} if isinstance(revision, pywikibot.page.Revision): revision = {revision}
pywikibot-commits@lists.wikimedia.org