revert r4823 replacing obsolete codes, fix for bug #3305243; update from trunk r9275
revert r4823 replacing obsolete codes, fix for bug #3305243; update from trunk r9275

pywikibot/core-migration-example