[PEP8] Re-arrange try/exception in SparqlQuery.query()
[PEP8] Re-arrange try/exception in SparqlQuery.query()

Change-Id: I5f4a07fa40cac0d305cd0eec9d6f6e1babed1dec

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