mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
18 lines
512 B
Python
18 lines
512 B
Python
|
|
|
|
def fail_batch_and_raise(exception):
|
|
if exception is None:
|
|
raise Exception()
|
|
elif exc_info is not None:
|
|
#This failed due to incorrect inference of the class of type(exception) as type.
|
|
raise type(exception), exception, exc_info[2]
|
|
|
|
#Weird Python2 nonsense.
|
|
def raise_tuple(cond):
|
|
if cond:
|
|
# This is OK. Honestly. Thankfully it's fixed in Python 3.
|
|
raise (Exception, "bananas", 17)
|
|
else:
|
|
#This is an error
|
|
raise (17, "bananas", Exception)
|