1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/failure/outer_stupid_explicit.py Mon Jan 13 23:58:23 2014 +0100
1.3 @@ -0,0 +1,18 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +"Inspired by difflib._mdiff._line_iterator and its from_line variable."
1.7 +
1.8 +def outer():
1.9 + def inner(x):
1.10 + if x:
1.11 + y = 1
1.12 + return y
1.13 + else:
1.14 + return y
1.15 + y = 2
1.16 + return inner
1.17 +
1.18 +result_1 = outer()(1)
1.19 +result_2 = outer()(0) # CPython fails with UnboundLocalError in inner
1.20 +
1.21 +# vim: tabstop=4 expandtab shiftwidth=4