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:
parent
9996158db4
commit
80f4487d17
|
@ -4,6 +4,8 @@ import datetime
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
from django.utils.lru_cache import lru_cache
|
||||||
|
|
||||||
|
|
||||||
def get_version(version=None):
|
def get_version(version=None):
|
||||||
"Returns a PEP 386-compliant version number from VERSION."
|
"Returns a PEP 386-compliant version number from VERSION."
|
||||||
|
@ -50,6 +52,7 @@ def get_complete_version(version=None):
|
||||||
return version
|
return version
|
||||||
|
|
||||||
|
|
||||||
|
@lru_cache()
|
||||||
def get_git_changeset():
|
def get_git_changeset():
|
||||||
"""Returns a numeric identifier of the latest git changeset.
|
"""Returns a numeric identifier of the latest git changeset.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue