or os.path.expanduser('~/.inputrc')
readline.read_init_file(initfile)
- histfile = os.path.expanduser('~/.python-history')
+ histfile = os.path.expanduser('~/.python_history')
try:
readline.read_history_file(histfile)
except IOError:
pass # No such file
def savehist():
- histfilesize = os.environ.get('HISTFILESIZE') \
- or os.environ.get('HISTSIZE')
- if histfilesize:
+ histsize = os.environ.get('HISTSIZE')
+ if histsize:
try:
- histfilesize = int(histfilesize)
+ histsize = int(histsize)
except ValueError:
pass
else:
- readline.set_history_length(histfilesize)
+ readline.set_history_length(histsize)
readline.write_history_file(histfile)
import atexit