Skip to content

Commit

Permalink
Merge pull request #267 from KasparNagu/master
Browse files Browse the repository at this point in the history
Improve and fix Site.expandtemplates
  • Loading branch information
AdamWill committed Feb 10, 2023
2 parents 6c70d13 + 12c2885 commit 8f0997d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mwclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,12 +1160,12 @@ def expandtemplates(self, text, title=None, generatexml=False):
"""

kwargs = {}
if title is None:
if title is not None:
kwargs['title'] = title
if generatexml:
kwargs['generatexml'] = '1'

result = self.get('expandtemplates', text=text, **kwargs)
result = self.post('expandtemplates', text=text, **kwargs)

if generatexml:
return result['expandtemplates']['*'], result['parsetree']['*']
Expand Down

0 comments on commit 8f0997d

Please sign in to comment.