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:
Tomáš Chvátal 2020-07-14 12:39:50 +00:00 committed by Git OBS Bridge
parent 0a2f94ded8
commit 6ce35be87f
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Jul 14 11:03:14 UTC 2020 - Antonio Larrosa <alarrosa@suse.com>
- 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.
-------------------------------------------------------------------
Mon Apr 27 13:18:52 UTC 2020 - Matej Cepl <mcepl@suse.com>