CodeQL library for Python
codeql/python-all 0.11.13 (changelog, source)
Search

Predicate hasContextmanagerDecorator

Holds if the function func has a contextlib.contextmanager.

Import path

import semmle.python.dataflow.new.internal.DataFlowDispatch
predicate hasContextmanagerDecorator(Function func)