Change all the function attributes from func_* -> __*__. This gets rid
of func_name, func_dict and func_doc as they already exist as __name__,
__dict__ and __doc__.
diff --git a/Lib/idlelib/CallTips.py b/Lib/idlelib/CallTips.py
index b395f15..9152eaa 100644
--- a/Lib/idlelib/CallTips.py
+++ b/Lib/idlelib/CallTips.py
@@ -147,15 +147,15 @@
fob = ob
# Try to build one for Python defined functions
if type(fob) in [types.FunctionType, types.LambdaType]:
- argcount = fob.func_code.co_argcount
- real_args = fob.func_code.co_varnames[arg_offset:argcount]
- defaults = fob.func_defaults or []
+ argcount = fob.__code__.co_argcount
+ real_args = fob.__code__.co_varnames[arg_offset:argcount]
+ defaults = fob.__defaults__ or []
defaults = list(map(lambda name: "=%s" % repr(name), defaults))
defaults = [""] * (len(real_args) - len(defaults)) + defaults
items = map(lambda arg, dflt: arg + dflt, real_args, defaults)
- if fob.func_code.co_flags & 0x4:
+ if fob.__code__.co_flags & 0x4:
items.append("...")
- if fob.func_code.co_flags & 0x8:
+ if fob.__code__.co_flags & 0x8:
items.append("***")
arg_text = ", ".join(items)
arg_text = "(%s)" % re.sub("\.\d+", "<tuple>", arg_text)