"""
def test_in(s):
- if s in ('ABC', 'BCD'):
+ if s in (u'ABC', u'BCD'):
return 1
- elif s.upper() in ('ABC', 'BCD'):
+ elif s.upper() in (u'ABC', u'BCD'):
return 2
elif len(s) in (1,2):
return 3
return 5
def test_not_in(s):
- if s not in ('ABC', 'BCD', 'CDE', 'CDEF'):
+ if s not in (u'ABC', u'BCD', u'CDE', u'CDEF'):
return 1
- elif s.upper() not in ('ABC', 'BCD', 'CDEF'):
+ elif s.upper() not in (u'ABC', u'BCD', u'CDEF'):
return 2
elif len(s) not in [3]:
return 3
return self.value
def no_as():
- with ContextManager("value"):
- print "hello"
+ with ContextManager(u"value"):
+ print u"hello"
def basic():
- with ContextManager("value") as x:
+ with ContextManager(u"value") as x:
print x
def with_exception(exit_ret):
try:
- with ContextManager("value", exit_ret=exit_ret) as value:
+ with ContextManager(u"value", exit_ret=exit_ret) as value:
print value
raise MyException()
except:
- print "outer except"
+ print u"outer except"
def multitarget():
with ContextManager((1, 2, (3, (4, 5)))) as (a, b, (c, (d, e))):