From 91692c31f757fe78e9a7376033f66772fc97f36b Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 4 Jul 2011 13:53:18 -0400 Subject: for-else constructs are handled properly, avoiding bogus partial branch warnings. Fixes issue #122. Bonus irony: this also makes while 1 loops automatically understood better too. --- test/farm/html/src/b.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'test/farm/html/src') diff --git a/test/farm/html/src/b.py b/test/farm/html/src/b.py index dffdd50f..3bf73a9f 100644 --- a/test/farm/html/src/b.py +++ b/test/farm/html/src/b.py @@ -16,13 +16,14 @@ def two(x): two(1) -def three_way(): - # for-else can be a three-way branch. - for i in range(10): - if i == 3: - break - else: - return 23 - return 17 +def three(): + try: + # This if has two branches, *neither* one taken. + if name_error_this_variable_doesnt_exist: + a = 1 + else: + a = 2 + except: + pass -three_way() +three() -- cgit v1.2.1