oamg/leapp

leapp/snactor/fixture.py is not compatible with py3

Closed this issue · 2 comments

func.func_code = _patched_name(func.func_code, name)

E           AttributeError: 'function' object has no attribute 'func_code'

This makes any exception happened during the testing of actors unreadable

@zhukovgreen leapp and leapp-repository need to be compatible with both python (py2 and py3), on leapp-repository we use six.PY3 to check it, since six package is one of the requirements..

@fellipeh I tried to fix it with just func.__code__ , but then it stuck with another issue somewhere when initializing CodeType here:

return types.CodeType(
code.co_argcount,
code.co_nlocals,
code.co_stacksize,
code.co_flags,
code.co_code,
code.co_consts,
code.co_names,
code.co_varnames,
code.co_filename,
name,
code.co_firstlineno,
code.co_lnotab,
code.co_freevars,
code.co_cellvars,

so I gave up for a while, and decided to report:)