Skip to content

Commit

Permalink
Fix python 2 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
danmichaelo committed Jul 26, 2017
1 parent f895738 commit 1b5aadb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mwtemplates/templateeditor2.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,10 @@ def __repr__(self):

def __getattr__(self, name):
def wrapper(*args, **kwargs):
return getattr(self.__str__(), name)(*args, **kwargs)
if six.PY3:
return getattr(self.__str__(), name)(*args, **kwargs)
else:
return getattr(self.__unicode__(), name)(*args, **kwargs)

return wrapper

Expand Down

0 comments on commit 1b5aadb

Please sign in to comment.