bug fix; RuntimeError: API query error (follow-up to r11751 and r11754)

https://mediawiki.org/wiki/Special:Code/pywikipedia/11762