mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
43 lines
625 B
Python
43 lines
625 B
Python
#Test that the flow control through nested trys is handled correctly.
|
|
|
|
def f1():
|
|
try:
|
|
x = call()
|
|
finally:
|
|
try:
|
|
another_call()
|
|
except:
|
|
pass
|
|
return x
|
|
|
|
def f2():
|
|
try:
|
|
x = call()
|
|
except:
|
|
try:
|
|
another_call()
|
|
finally:
|
|
x = 0
|
|
return x
|
|
|
|
def f3():
|
|
try:
|
|
x = call()
|
|
except:
|
|
try:
|
|
another_call()
|
|
except:
|
|
pass
|
|
return x
|
|
|
|
def f4():
|
|
try:
|
|
x = call()
|
|
finally:
|
|
try:
|
|
another_call()
|
|
finally:
|
|
x = 0
|
|
return x
|
|
|