Don't use lambda functions for testing the magic run function -- the access to the stack seems to be different in Python3.