From 80f4487d17a0040e9be35e7ee6ac478bafe6504a Mon Sep 17 00:00:00 2001 From: Alexander Schepanovski Date: Thu, 19 Jun 2014 17:05:50 +0800 Subject: [PATCH] Fixed #22867 -- Memoized django.utils.version.get_git_changeset(). This improves pickling speed in prelease versions of Django; refs #21430. --- django/utils/version.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/django/utils/version.py b/django/utils/version.py index c680dbdc4a..19486b7c6d 100644 --- a/django/utils/version.py +++ b/django/utils/version.py @@ -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.