Commit 13864703 authored by Adrian Holovaty's avatar Adrian Holovaty
Browse files

Removed a bunch more Python 2.4 workarounds now that we don't support that...

Removed a bunch more Python 2.4 workarounds now that we don't support that version. Refs #15702 -- thanks to jonash for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent a87be355
Loading
Loading
Loading
Loading
+11 −14
Original line number Diff line number Diff line
@@ -17,9 +17,6 @@ class EmailBackend(BaseEmailBackend):
        if not email_messages:
            return
        self._lock.acquire()
        try:
            # The try-except is nested to allow for
            # Python 2.4 support (Refs #12147)
        try:
            stream_created = self.open()
            for message in email_messages:
+1 −4
Original line number Diff line number Diff line
@@ -3,10 +3,7 @@ import os
import random
import time
from email import Charset, Encoders
try:
from email.generator import Generator
except ImportError:
    from email.Generator import Generator # TODO: Remove when remove Python 2.4 support
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
+0 −5
Original line number Diff line number Diff line
@@ -4,11 +4,6 @@ from django.contrib.contenttypes.generic import GenericForeignKey, GenericRelati
from django.core.management.color import color_style
from django.utils.itercompat import is_iterable

try:
    any
except NameError:
    from django.utils.itercompat import any

class ModelErrorCollection:
    def __init__(self, outfile=sys.stdout):
        self.errors = []
+0 −1
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@ from django.core import signals
from django.core.exceptions import ImproperlyConfigured
from django.db.utils import ConnectionHandler, ConnectionRouter, load_backend, DEFAULT_DB_ALIAS, \
                            DatabaseError, IntegrityError
from django.utils.functional import curry

__all__ = ('backend', 'connection', 'connections', 'router', 'DatabaseError',
    'IntegrityError', 'DEFAULT_DB_ALIAS')
+3 −4
Original line number Diff line number Diff line
import datetime
import decimal
import hashlib
from time import time

from django.utils.hashcompat import md5_constructor
from django.utils.log import getLogger


@@ -130,9 +130,8 @@ def truncate_name(name, length=None, hash_len=4):
    if length is None or len(name) <= length:
        return name

    hash = md5_constructor(name).hexdigest()[:hash_len]

    return '%s%s' % (name[:length-hash_len], hash)
    hsh = hashlib.md5(name).hexdigest()[:hash_len]
    return '%s%s' % (name[:length-hash_len], hsh)

def format_number(value, max_digits, decimal_places):
    """
Loading