From 08457a7a6b6ad4f518fad0d5bca094a2b5b38fbe Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 9 Jul 2010 12:18:38 +0200 Subject: Added python 2.4 support: Repo will now use the original GitCmdObjectDB in python 2.4, as the pure python implementation cannot work without memory maps --- lib/git/repo/base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/git/repo/base.py') diff --git a/lib/git/repo/base.py b/lib/git/repo/base.py index d45dd713..4456b1e9 100644 --- a/lib/git/repo/base.py +++ b/lib/git/repo/base.py @@ -34,6 +34,11 @@ import os import sys import re +DefaultDBType = GitDB +if sys.version_info[1] < 5: # python 2.4 compatiblity + DefaultDBType = GitCmdObjectDB +# END handle python 2.4 + __all__ = ('Repo', ) @@ -66,7 +71,7 @@ class Repo(object): # represents the configuration level of a configuration file config_level = ("system", "global", "repository") - def __init__(self, path=None, odbt = GitDB): + def __init__(self, path=None, odbt = DefaultDBType): """Create a new Repo instance :param path: is the path to either the root git directory or the bare git repo:: -- cgit v1.2.3