diff options
| author | Claude Paroz <claude@2xlibre.net> | 2017-01-20 10:20:53 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2017-01-20 14:13:55 +0100 |
| commit | 042b7350a080cc964f913faf1cf7f0097f650a58 (patch) | |
| tree | 4ad77d8fc8ae016770afe01a543a6042fa02357a /django/utils | |
| parent | 4e729feaa647547f25debb1cb63dec989dc41a20 (diff) | |
Refs #23919 -- Removed unneeded str() calls
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/html.py | 2 | ||||
| -rw-r--r-- | django/utils/http.py | 6 | ||||
| -rw-r--r-- | django/utils/safestring.py | 2 | ||||
| -rw-r--r-- | django/utils/translation/trans_real.py | 3 | ||||
| -rw-r--r-- | django/utils/version.py | 2 |
5 files changed, 7 insertions, 8 deletions
diff --git a/django/utils/html.py b/django/utils/html.py index 63335d74b4..fb9c18219c 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -193,7 +193,7 @@ def smart_urlquote(url): # Tilde is part of RFC3986 Unreserved Characters # http://tools.ietf.org/html/rfc3986#section-2.3 # See also http://bugs.python.org/issue16285 - segment = quote(segment, safe=RFC3986_SUBDELIMS + RFC3986_GENDELIMS + str('~')) + segment = quote(segment, safe=RFC3986_SUBDELIMS + RFC3986_GENDELIMS + '~') return force_text(segment) # Handle IDN before quoting. diff --git a/django/utils/http.py b/django/utils/http.py index 5791856813..7b15dc2812 100644 --- a/django/utils/http.py +++ b/django/utils/http.py @@ -40,8 +40,8 @@ RFC1123_DATE = re.compile(r'^\w{3}, %s %s %s %s GMT$' % (__D, __M, __Y, __T)) RFC850_DATE = re.compile(r'^\w{6,9}, %s-%s-%s %s GMT$' % (__D, __M, __Y2, __T)) ASCTIME_DATE = re.compile(r'^\w{3} %s %s %s %s$' % (__M, __D2, __T, __Y)) -RFC3986_GENDELIMS = str(":/?#[]@") -RFC3986_SUBDELIMS = str("!$&'()*+,;=") +RFC3986_GENDELIMS = ":/?#[]@" +RFC3986_SUBDELIMS = "!$&'()*+,;=" FIELDS_MATCH = re.compile('[&;]') @@ -365,7 +365,7 @@ def limited_parse_qsl(qs, keep_blank_values=False, encoding='utf-8', for name_value in pairs: if not name_value: continue - nv = name_value.split(str('='), 1) + nv = name_value.split('=', 1) if len(nv) != 2: # Handle case of a control-name with no equal sign if keep_blank_values: diff --git a/django/utils/safestring.py b/django/utils/safestring.py index fe5ca422c3..2dfbd01cfe 100644 --- a/django/utils/safestring.py +++ b/django/utils/safestring.py @@ -95,7 +95,7 @@ def _safety_decorator(safety_marker, func): def mark_safe(s): """ Explicitly mark a string as safe for (HTML) output purposes. The returned - object can be used everywhere a string or unicode object is appropriate. + object can be used everywhere a string is appropriate. If used on a method as a decorator, mark the returned data as safe. diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py index 14bb0ce786..62ff122621 100644 --- a/django/utils/translation/trans_real.py +++ b/django/utils/translation/trans_real.py @@ -307,8 +307,7 @@ def do_translate(message, translation_function): """ global _default - # str() is allowing a bytestring message to remain bytestring on Python 2 - eol_message = message.replace(str('\r\n'), str('\n')).replace(str('\r'), str('\n')) + eol_message = message.replace('\r\n', '\n').replace('\r', '\n') if len(eol_message) == 0: # Returns an empty value of the corresponding type if an empty message diff --git a/django/utils/version.py b/django/utils/version.py index e9666f906e..b80d445d0c 100644 --- a/django/utils/version.py +++ b/django/utils/version.py @@ -25,7 +25,7 @@ def get_version(version=None): mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'rc'} sub = mapping[version[3]] + str(version[4]) - return str(main + sub) + return main + sub def get_main_version(version=None): |
