forked from pool/shared-python-startup
Accepting request 820864 from home:alarrosa:branches:devel:languages:python:Factory
- Import readline in the save_history handler. Otherwise the call to readline.write_history_file doesn't work (the readline import at the beginning of the file is already removed) and is silently ignored by the exception catcher. OBS-URL: https://build.opensuse.org/request/show/820864 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/shared-python-startup?expand=0&rev=11
This commit is contained in:
committed by
Git OBS Bridge
parent
67b93b4a37
commit
927bec7b4c
@@ -15,10 +15,12 @@ historyPath = os.path.expanduser("~/.pyhistory%s" % ver)
|
||||
|
||||
# handler for saving history
|
||||
def save_history(historyPath=historyPath):
|
||||
import readline
|
||||
try:
|
||||
readline.write_history_file(historyPath)
|
||||
except:
|
||||
pass
|
||||
del readline
|
||||
|
||||
|
||||
# read history, if it exists
|
||||
|
||||
Reference in New Issue
Block a user