dabo Commit
Revision 6965
Date: 2011-11-09 08:57:11 -0800 (Wed, 09 Nov 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6965
Changed:
U trunk/dabo/ui/uiwx/dShell.py
Log:
Ran into some cases where an old command was removed from the shell history,
which caused the index() call to fail. This change handles that case more
gracefully.
Diff:
Modified: trunk/dabo/ui/uiwx/dShell.py
===================================================================
--- trunk/dabo/ui/uiwx/dShell.py 2011-11-04 19:57:08 UTC (rev 6964)
+++ trunk/dabo/ui/uiwx/dShell.py 2011-11-09 16:57:11 UTC (rev 6965)
@@ -554,7 +554,11 @@
if hp.ok:
cmd = hp.getCmd()
if cmd:
- pos = self.shell.history.index(cmd)
+ try:
+ pos = self.shell.history.index(cmd)
+ except ValueError:
+ # Not in the list
+ return
self.shell.replaceFromHistory(pos -
self.shell.historyIndex)
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]