[IMPR] Avoid deeply nested flow statements
[IMPR] Avoid deeply nested flow statements

Change-Id: Ibb76b359b86420741f432d3d22fc12d08854a26b

wikimedia/pywikibot-core,PersianWikipedia/pywikibot-core,wikimedia/pywikibot-core