Fix #28: Add `import coccinelle` before running Python code
The first commit adds import coccinelle
before running the Python code
associated to a constraint (run_constraint
) or the generator of
a fresh identifier (run_fresh_id
), and the second commit refactors some
code duplication in Python initialization and execution.
Beforehand, import coccinelle
was only run in python_code
in
cocci.ml
, which is only evaluated in the initialization script rule.
The first commit adds a test for Python initialization: unfortunately, the
test passes the testsuite even without this commit, before other tests
run before initpython.cocci
already have initialization script
rules, which turn the Python interpreter in a state where the test can
pass. I don't know how to make the tests "stateless".