提交 598354c0 编写于 作者: B Brandon Casey 提交者: Junio C Hamano

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: NBrandon Casey <bcasey@nvidia.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 5d417842
...@@ -131,7 +131,7 @@ Issues of note: ...@@ -131,7 +131,7 @@ Issues of note:
use English. Under autoconf the configure script will do this use English. Under autoconf the configure script will do this
automatically if it can't find libintl on the system. automatically if it can't find libintl on the system.
- Python version 2.6 or later is needed to use the git-p4 - Python version 2.5 or later is needed to use the git-p4
interface to Perforce. interface to Perforce.
- Some platform specific issues are dealt with Makefile rules, - Some platform specific issues are dealt with Makefile rules,
......
...@@ -742,7 +742,8 @@ def wildcard_encode(path): ...@@ -742,7 +742,8 @@ def wildcard_encode(path):
return path return path
def wildcard_present(path): def wildcard_present(path):
return path.translate(None, "*#@%") != path m = re.search("[*#@%]", path)
return m is not None
class Command: class Command:
def __init__(self): def __init__(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册