Re: [Python-Dev] cpython (3.2): Issue12510: Attempting to get invalid tooltip no longer closes Idle.

Am 28.05.2012 03:55, schrieb terry.reedy:
http://hg.python.org/cpython/rev/4a7582866735 changeset: 77195:4a7582866735 branch: 3.2 parent: 77189:6737c2ca98ee user: Terry Jan Reedy tjreedy@udel.edu date: Sun May 27 21:29:17 2012 -0400 summary: Issue12510: Attempting to get invalid tooltip no longer closes Idle. Original patch by Roger Serwy.
files: Lib/idlelib/CallTips.py | 9 ++++++--- Misc/NEWS | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/Lib/idlelib/CallTips.py b/Lib/idlelib/CallTips.py --- a/Lib/idlelib/CallTips.py +++ b/Lib/idlelib/CallTips.py @@ -110,7 +110,9 @@ namespace.update(__main__.__dict__) try: 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
Is something missing here? The comment text seems cut off.
except: return None
"except Exception" may be better here.
Georg

On 5/28/2012 2:53 AM, Georg Brandl wrote:
Am 28.05.2012 03:55, schrieb terry.reedy:
namespace.update(__main__.__dict__) try: 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
Is something missing here? The comment text seems cut off.
There should be a ; at the end of the first line, but I think I will rewrite the comment instead.
except: return None
"except Exception" may be better here.
Idle's Shell catches all exceptions. I think the attempt to provide an optional help (a function signature) should too.

On Mon, May 28, 2012 at 8:44 PM, Terry Reedy tjreedy@udel.edu wrote:
- except:
return None
"except Exception" may be better here.
Idle's Shell catches all exceptions. I think the attempt to provide an optional help (a function signature) should too.
Can you explain what this means? You should probably not have a bare except - I'm not sure what IDLE has to do with it.

On 5/28/2012 9:48 PM, Brian Curtin wrote:
On Mon, May 28, 2012 at 8:44 PM, Terry Reedytjreedy@udel.edu wrote:
snipped context: return eval(user_entered_expression, namespace)
except: return None
"except Exception" may be better here.
Idle's Shell catches all exceptions. I think the attempt to provide an optional help (a function signature) should too.
Can you explain what this means?
What what means? I am not sure what you are asking. The issue might help http://bugs.python.org/issue12510
You should probably not have a bare except
Idle code already has many of them Some perhaps should not be, but I cannot tell with my current level of understanding of how Idle works. Would you prefer 'except BaseException:' ?
I'm not sure what IDLE has to do with it.
This is a patch to Idle.
tjr

On 5/28/2012 10:59 PM, Terry Reedy wrote:
On 5/28/2012 9:48 PM, Brian Curtin wrote:
You should probably not have a bare except
Idle code already has many of them
At least 29 by grep. After further discussion, Roger Serwy and I have agreed that we should start reducing that number rather than increasing it. There is a nearby 'except:' that I believe should be 'except AttributeError:'.
participants (3)
-
Brian Curtin
-
Georg Brandl
-
Terry Reedy