Fixed #22867 -- Memoized django.utils.version.get_git_changeset().

This improves pickling speed in prelease versions of Django; refs #21430.
This commit is contained in:
Alexander Schepanovski 2014-06-19 17:05:50 +08:00 committed by Tim Graham
parent 9996158db4
commit 80f4487d17
1 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,8 @@ import datetime
import os
import subprocess
from django.utils.lru_cache import lru_cache
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
@ -50,6 +52,7 @@ def get_complete_version(version=None):
return version
@lru_cache()
def get_git_changeset():
"""Returns a numeric identifier of the latest git changeset.