I compiled your code and get the same output as yours.
However my implementation is different from yours. While we both have an EvalFrame function, your implementation built an module in Python, but I prefer to modify Python source and compile a full distribution.
To be more specific, I first implement an EvalFrame function, which is a simple call of _PyEval_EvalFrameDefault. I compile this function into a .so file. Then in Python/pylifecycle.c, I use dlsym to get the EvalFrame function to replace the function interp->eval_frame. So each time when interp->eval_frame(default as _PyEval_EvalFrameDefault) is called, what is really called is my EvalFrame function. This seems should be fine, but it doesn't work.
To compile it, get a Python-3.6.1.tgz source from Python official website. Replace Python/pylifecycle.c with the one on github. Then use CMake to compile the libPubbon.so, and get into Python directory to make Python. It will give an error message, and the python.exe target cannot run.