Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[py3] Removed excessive usage of smart_bytes

  • Loading branch information...
commit f8ea12f36b7f2e077887a1a02478ea24884b4514 1 parent 814fde3
Claude Paroz authored
4  django/core/handlers/wsgi.py
@@ -9,7 +9,7 @@
9 9
 from django.core.handlers import base
10 10
 from django.core.urlresolvers import set_script_prefix
11 11
 from django.utils import datastructures
12  
-from django.utils.encoding import force_text, smart_bytes, iri_to_uri
  12
+from django.utils.encoding import force_text, smart_str, iri_to_uri
13 13
 from django.utils.log import getLogger
14 14
 
15 15
 logger = getLogger('django.request')
@@ -246,5 +246,5 @@ def __call__(self, environ, start_response):
246 246
         response_headers = [(str(k), str(v)) for k, v in response.items()]
247 247
         for c in response.cookies.values():
248 248
             response_headers.append((str('Set-Cookie'), str(c.output(header=''))))
249  
-        start_response(smart_bytes(status), response_headers)
  249
+        start_response(smart_str(status), response_headers)
250 250
         return response
4  django/db/models/base.py
@@ -23,7 +23,7 @@
23 23
 from django.db.models.loading import register_models, get_model
24 24
 from django.utils.translation import ugettext_lazy as _
25 25
 from django.utils.functional import curry
26  
-from django.utils.encoding import smart_bytes, smart_str, force_text
  26
+from django.utils.encoding import smart_str, force_text
27 27
 from django.utils import six
28 28
 from django.utils.text import get_text_list, capfirst
29 29
 
@@ -654,7 +654,7 @@ def _get_next_or_previous_by_FIELD(self, field, is_next, **kwargs):
654 654
             raise ValueError("get_next/get_previous cannot be used on unsaved objects.")
655 655
         op = is_next and 'gt' or 'lt'
656 656
         order = not is_next and '-' or ''
657  
-        param = smart_bytes(getattr(self, field.attname))
  657
+        param = force_text(getattr(self, field.attname))
658 658
         q = Q(**{'%s__%s' % (field.name, op): param})
659 659
         q = q|Q(**{field.name: param, 'pk__%s' % op: self.pk})
660 660
         qs = self.__class__._default_manager.using(self._state.db).filter(**kwargs).filter(q).order_by('%s%s' % (order, field.name), '%spk' % order)

0 notes on commit f8ea12f

Please sign in to comment.
Something went wrong with that request. Please try again.