##// END OF EJS Templates
check history length before attempting to access old members. Closes #189
vivainio -
Show More
@@ -6,7 +6,7 b' Requires Python 2.3 or newer.'
6
6
7 This file contains all the classes and helper functions specific to IPython.
7 This file contains all the classes and helper functions specific to IPython.
8
8
9 $Id: iplib.py 2914 2007-12-31 12:53:16Z vivainio $
9 $Id: iplib.py 2915 2007-12-31 13:05:11Z vivainio $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
@@ -2092,10 +2092,11 b' want to merge them back into the new files.""" % locals()'
2092 if self.has_readline: # and some config option is set?
2092 if self.has_readline: # and some config option is set?
2093 try:
2093 try:
2094 histlen = self.readline.get_current_history_length()
2094 histlen = self.readline.get_current_history_length()
2095 newhist = self.input_hist_raw[-1].rstrip()
2095 if histlen > 1:
2096 self.readline.remove_history_item(histlen-1)
2096 newhist = self.input_hist_raw[-1].rstrip()
2097 self.readline.replace_history_item(histlen-2,
2097 self.readline.remove_history_item(histlen-1)
2098 newhist.encode(self.stdin_encoding))
2098 self.readline.replace_history_item(histlen-2,
2099 newhist.encode(self.stdin_encoding))
2099 except AttributeError:
2100 except AttributeError:
2100 pass # re{move,place}_history_item are new in 2.4.
2101 pass # re{move,place}_history_item are new in 2.4.
2101 else:
2102 else:
General Comments 0
You need to be logged in to leave comments. Login now