Merge pull request #130 from andrewwong1221/python3-octal-fix

Fixing Python3 Octal Constant Compatibility Issue
This commit is contained in:
Tim Pope 2014-01-29 12:03:17 -08:00
commit 7bc3ee4c1a

View File

@ -17,7 +17,7 @@ def vim_encode(data):
elif isinstance(data, str): elif isinstance(data, str):
str_list = [] str_list = []
for c in data: for c in data:
if (000 <= ord(c) and ord(c) <= 037) or c == '"' or c == "\\": if (0 <= ord(c) and ord(c) <= 31) or c == '"' or c == "\\":
str_list.append("\\%03o" % ord(c)) str_list.append("\\%03o" % ord(c))
else: else:
str_list.append(c) str_list.append(c)