mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
Replaced "not PY3" by "PY2", new in six 1.4.0.
This commit is contained in:
@@ -30,7 +30,7 @@ def python_2_unicode_compatible(klass):
|
||||
To support Python 2 and 3 with a single code base, define a __str__ method
|
||||
returning text and apply this decorator to the class.
|
||||
"""
|
||||
if not six.PY3:
|
||||
if six.PY2:
|
||||
klass.__unicode__ = klass.__str__
|
||||
klass.__str__ = lambda self: self.__unicode__().encode('utf-8')
|
||||
return klass
|
||||
|
||||
Reference in New Issue
Block a user