mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
python: Inline expectation should have space after $
This was a regex-find-replace from `# \$(?! )` (using a negative lookahead) to `# $ `.
This commit is contained in:
@@ -61,35 +61,35 @@ try:
|
||||
val.attr
|
||||
except Exception:
|
||||
print (2)
|
||||
except AttributeError: # $Alert[py/unreachable-except]
|
||||
except AttributeError: # $ Alert[py/unreachable-except]
|
||||
print (3)
|
||||
|
||||
class MyExc(ValueError):
|
||||
pass
|
||||
pass
|
||||
|
||||
try:
|
||||
pass
|
||||
except ValueError:
|
||||
pass
|
||||
except MyExc: # $MISSING:Alert[py/unreachable-except] # Missing due to dataflow limitiation preventing MyExc from being tracked here.
|
||||
pass
|
||||
pass
|
||||
except MyExc: # $ MISSING:Alert[py/unreachable-except] # Missing due to dataflow limitiation preventing MyExc from being tracked here.
|
||||
pass
|
||||
|
||||
class MyBaseExc(Exception):
|
||||
pass
|
||||
pass
|
||||
|
||||
class MySubExc(MyBaseExc):
|
||||
pass
|
||||
pass
|
||||
|
||||
try:
|
||||
pass
|
||||
except MyBaseExc:
|
||||
pass
|
||||
except MySubExc: # $MISSING:Alert[py/unreachable-except] # Missing due to dataflow limitation preventing MyExc from being tracked here.
|
||||
pass
|
||||
pass
|
||||
except MySubExc: # $ MISSING:Alert[py/unreachable-except] # Missing due to dataflow limitation preventing MyExc from being tracked here.
|
||||
pass
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
#Catch BaseException
|
||||
def catch_base_exception():
|
||||
try:
|
||||
@@ -97,13 +97,13 @@ def catch_base_exception():
|
||||
except BaseException:
|
||||
#Consumes KeyboardInterrupt
|
||||
pass
|
||||
|
||||
|
||||
def catch_base_exception_ok():
|
||||
try:
|
||||
illegal_raise()
|
||||
except BaseException:
|
||||
raise
|
||||
|
||||
|
||||
def legal_handler1():
|
||||
try:
|
||||
illegal_raise()
|
||||
|
||||
Reference in New Issue
Block a user