objstr: *strip(): Fix handling of one-char subject strings.

This commit is contained in:
Paul Sokolovsky
2014-05-30 03:07:05 +03:00
parent 059f95b2cb
commit bcdffe53c6
2 changed files with 13 additions and 2 deletions

View File

@@ -20,3 +20,14 @@ try:
print('mississippi'.rstrip(b'ipz'))
except TypeError:
print("TypeError")
# single-char subj string used to give a problem
print("a".strip())
print("a".lstrip())
print("a".rstrip())
print(" a".strip())
print(" a".lstrip())
print(" a".rstrip())
print("a ".strip())
print("a ".lstrip())
print("a ".rstrip())