Fix python 3 compatibility

Use __code__.co_varnames instead of func_code.co_varnames, for python 3
compatibility. Should pass travis CI testing now.