mirror of
https://github.com/django/django.git
synced 2025-09-19 00:40:11 +00:00
[py3] Replaced unicode/str by six.text_type/bytes.
This commit is contained in:
parent
3cb2457f46
commit
bdca5ea345
96 changed files with 376 additions and 294 deletions
|
@ -21,6 +21,7 @@ from django.utils.dates import MONTHS, MONTHS_3, MONTHS_ALT, MONTHS_AP, WEEKDAYS
|
|||
from django.utils.tzinfo import LocalTimezone
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils.encoding import force_unicode
|
||||
from django.utils import six
|
||||
from django.utils.timezone import is_aware, is_naive
|
||||
|
||||
re_formatchars = re.compile(r'(?<!\\)([aAbBcdDeEfFgGhHiIjlLmMnNoOPrsStTUuwWyYzZ])')
|
||||
|
@ -236,7 +237,7 @@ class DateFormat(TimeFormat):
|
|||
name = self.timezone and self.timezone.tzname(self.data) or None
|
||||
if name is None:
|
||||
name = self.format('O')
|
||||
return unicode(name)
|
||||
return six.text_type(name)
|
||||
|
||||
def U(self):
|
||||
"Seconds since the Unix epoch (January 1 1970 00:00:00 GMT)"
|
||||
|
@ -277,7 +278,7 @@ class DateFormat(TimeFormat):
|
|||
|
||||
def y(self):
|
||||
"Year, 2 digits; e.g. '99'"
|
||||
return unicode(self.data.year)[2:]
|
||||
return six.text_type(self.data.year)[2:]
|
||||
|
||||
def Y(self):
|
||||
"Year, 4 digits; e.g. '1999'"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue