From 524639c8c6b5bb411a003edd63bd82172dbdac9c Mon Sep 17 00:00:00 2001 From: Peter Liebetraut Date: Sun, 15 Apr 2018 16:05:43 +0200 Subject: [PATCH] FIX: Compatibility issue of code inspection with Python >=3.4 (fixes #8) --- pyzos/zosutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyzos/zosutils.py b/pyzos/zosutils.py index ccdb0e4..a55933a 100644 --- a/pyzos/zosutils.py +++ b/pyzos/zosutils.py @@ -54,9 +54,9 @@ def replicate_methods(srcObj, dstObj): def zos_wrapper_deco(func): def wrapper(*args, **kwargs): return wrapped_zos_object(func(*args, **kwargs)) - varnames = func.im_func.func_code.co_varnames # alternative is to use inspect.getargspec + varnames = func.__func__.__code__.co_varnames # alternative is to use inspect.getargspec params = [par for par in varnames if par not in ('self', 'ret')] # removes 'self' and 'ret' - wrapper.__doc__ = func.im_func.func_name + '(' + ', '.join(params) + ')' + wrapper.__doc__ = func.__func__.__code__.co_name + '(' + ', '.join(params) + ')' return wrapper # for key, value in get_callable_method_dict(srcObj).items():