Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make __str__ compatible with py2 (#232)
* make __str__ compatible with py2

See a similar implementation in Django:
https://docs.djangoproject.com/en/1.11/_modules/django/utils/six/#python_2_unicode_compatible

* Update values.py

Fixed import sorting for six
  • Loading branch information
bloodywing authored and prologic committed Apr 19, 2018
1 parent f21e80a commit f0cb656
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion circuits/core/values.py
Expand Up @@ -73,7 +73,8 @@ def __repr__(self):

def __str__(self):
"x.__str__() <==> str(x)"

if PY2:
return self.value.encode('utf-8')
return str(self.value)

def inform(self, force=False):
Expand Down

0 comments on commit f0cb656

Please sign in to comment.