Permalink
Browse files

Ignore AttributeError if readline.remove_history_item() is missing - …

…thanks to Blitzboom for the bug report
  • Loading branch information...
1 parent c7fdb92 commit f25f93037e94f2525969f17afc5e365e66323ca2 @ahihi ahihi committed Jun 19, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 goxsh.py
View
@@ -358,7 +358,11 @@ def __cmd_login__(self, username = u""):
if not username:
while not username:
username = raw_input(u"Username: ").decode(self.__encoding)
- readline.remove_history_item(readline.get_current_history_length() - 1)
+ try:
+ readline.remove_history_item(readline.get_current_history_length() - 1)
+ except AttributeError:
+ # Some systems lack remove_history_item
+ pass
password = u""
while not password:
password = getpass.getpass()

0 comments on commit f25f930

Please sign in to comment.