diff options
author | scoder <none@none> | 2006-11-22 15:51:57 +0100 |
---|---|---|
committer | scoder <none@none> | 2006-11-22 15:51:57 +0100 |
commit | dd7fd955ea8112530bc0b04a44b482d320e7deb6 (patch) | |
tree | 34e99bfadb3167aeb1ab9ada29858e865029760d /versioninfo.py | |
parent | a5f0f7f0aaa26c9c452380603fcc2f3589e183d7 (diff) | |
download | python-lxml-dd7fd955ea8112530bc0b04a44b482d320e7deb6.tar.gz |
[svn r2062] small fix to prevent version() from repeatedly reading version.txt
--HG--
branch : trunk
Diffstat (limited to 'versioninfo.py')
-rw-r--r-- | versioninfo.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/versioninfo.py b/versioninfo.py index ca986952..379461d3 100644 --- a/versioninfo.py +++ b/versioninfo.py @@ -1,7 +1,12 @@ import os, sys, re +__LXML_VERSION = None + def version(): - return open(os.path.join(get_src_dir(), 'version.txt')).read().strip() + global __LXML_VERSION + if __LXML_VERSION is None: + __LXML_VERSION = open(os.path.join(get_src_dir(), 'version.txt')).read().strip() + return __LXML_VERSION def branch_version(): return version()[:3] |