Commit d9d276b0 authored by Terry Jan Reedy's avatar Terry Jan Reedy

Issue12510: Attempting to get invalid tooltip no longer closes Idle.

Original patch by Roger Serwy.
parent b42b6eba
...@@ -112,7 +112,9 @@ class CallTips: ...@@ -112,7 +112,9 @@ class CallTips:
namespace.update(__main__.__dict__) namespace.update(__main__.__dict__)
try: try:
return eval(name, namespace) return eval(name, namespace)
except (NameError, AttributeError): # any exception is possible if evalfuncs True in open_calltip
# at least Syntax, Name, Attribute, Index, and Key E. if not
except:
return None return None
def _find_constructor(class_ob): def _find_constructor(class_ob):
...@@ -127,9 +129,10 @@ def _find_constructor(class_ob): ...@@ -127,9 +129,10 @@ def _find_constructor(class_ob):
return None return None
def get_arg_text(ob): def get_arg_text(ob):
"""Get a string describing the arguments for the given object""" """Get a string describing the arguments for the given object,
only if it is callable."""
arg_text = "" arg_text = ""
if ob is not None: if ob is not None and hasattr(ob, '__call__'):
arg_offset = 0 arg_offset = 0
if type(ob) in (types.ClassType, types.TypeType): if type(ob) in (types.ClassType, types.TypeType):
# Look for the highest __init__ in the class chain. # Look for the highest __init__ in the class chain.
......
...@@ -64,6 +64,9 @@ Core and Builtins ...@@ -64,6 +64,9 @@ Core and Builtins
Library Library
------- -------
- Issue12510: Attempting to get invalid tooltip no longer closes Idle.
Original patch by Roger Serwy.
- Issue #10365: File open dialog now works instead of crashing - Issue #10365: File open dialog now works instead of crashing
even when parent window is closed. Patch by Roger Serwy. even when parent window is closed. Patch by Roger Serwy.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment