Skip to content

sha deprecated from py 2.5 #2

@tredoe

Description

@tredoe

For compatibility with older python version, in django.utils.hashcompat there is a sha_constructor that can be used specifically for this.

So,

value = sha.new(request.POST.get(self.key_field, '')).hexdigest()

could be replaced with:

from django.utils.hashcompat import sha_constructor
value = sha_constructor(request.POST.get(self.key_field, '')).hexdigest()

http://code.djangoproject.com/browser/django/trunk/django/utils/hashcompat.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions