From 598354c0ad4198daff279c34a96f42e4d91fb4e6 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Sat, 26 Jan 2013 11:14:32 -0800 Subject: git-p4.py: support Python 2.5 Python 2.5 and older do not accept None as the first argument to translate() and complain with: TypeError: expected a character buffer object As suggested by Pete Wyckoff, let's just replace the call to translate() with a regex search which should be more clear and more portable. This allows git-p4 to be used with Python 2.5. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- git-p4.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'git-p4.py') diff --git a/git-p4.py b/git-p4.py index 551aec9417..a041b49818 100755 --- a/git-p4.py +++ b/git-p4.py @@ -742,7 +742,8 @@ def wildcard_encode(path): return path def wildcard_present(path): - return path.translate(None, "*#@%") != path + m = re.search("[*#@%]", path) + return m is not None class Command: def __init__(self): -- cgit v1.2.3