Committing patch #591250 which provides "str1 in str2" when str1 is a
string of longer than 1 character.
diff --git a/Lib/test/test_contains.py b/Lib/test/test_contains.py
index 9abed15..04eedf1 100644
--- a/Lib/test/test_contains.py
+++ b/Lib/test/test_contains.py
@@ -45,17 +45,8 @@
check('c' in 'abc', "'c' not in 'abc'")
check('d' not in 'abc', "'d' in 'abc'")
-try:
- '' in 'abc'
- check(0, "'' in 'abc' did not raise error")
-except TypeError:
- pass
-
-try:
- 'ab' in 'abc'
- check(0, "'ab' in 'abc' did not raise error")
-except TypeError:
- pass
+check('' in '', "'' not in ''")
+check('' in 'abc', "'' not in 'abc'")
try:
None in 'abc'
@@ -71,17 +62,12 @@
check('c' in unicode('abc'), "'c' not in u'abc'")
check('d' not in unicode('abc'), "'d' in u'abc'")
- try:
- '' in unicode('abc')
- check(0, "'' in u'abc' did not raise error")
- except TypeError:
- pass
-
- try:
- 'ab' in unicode('abc')
- check(0, "'ab' in u'abc' did not raise error")
- except TypeError:
- pass
+ check('' in unicode(''), "'' not in u''")
+ check(unicode('') in '', "u'' not in ''")
+ check(unicode('') in unicode(''), "u'' not in u''")
+ check('' in unicode('abc'), "'' not in u'abc'")
+ check(unicode('') in 'abc', "u'' not in 'abc'")
+ check(unicode('') in unicode('abc'), "u'' not in u'abc'")
try:
None in unicode('abc')
@@ -94,35 +80,11 @@
check(unicode('c') in unicode('abc'), "u'c' not in u'abc'")
check(unicode('d') not in unicode('abc'), "u'd' in u'abc'")
- try:
- unicode('') in unicode('abc')
- check(0, "u'' in u'abc' did not raise error")
- except TypeError:
- pass
-
- try:
- unicode('ab') in unicode('abc')
- check(0, "u'ab' in u'abc' did not raise error")
- except TypeError:
- pass
-
# Test Unicode char in string
check(unicode('c') in 'abc', "u'c' not in 'abc'")
check(unicode('d') not in 'abc', "u'd' in 'abc'")
- try:
- unicode('') in 'abc'
- check(0, "u'' in 'abc' did not raise error")
- except TypeError:
- pass
-
- try:
- unicode('ab') in 'abc'
- check(0, "u'ab' in 'abc' did not raise error")
- except TypeError:
- pass
-
# A collection of tests on builtin sequence types
a = range(10)
for i in a: