From 2d35873f1c79f067a70358aae0ce5ac92e8de87d Mon Sep 17 00:00:00 2001 From: David Cramer Date: Mon, 6 May 2013 12:24:04 -0700 Subject: [PATCH] Correct atexit hook --- python/pythonrc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/pythonrc.py b/python/pythonrc.py index 4594c20..c52b57b 100644 --- a/python/pythonrc.py +++ b/python/pythonrc.py @@ -17,4 +17,8 @@ readline.set_history_length(1024 * 5) -atexit.register(lambda x=history: readline.write_history_file(x)) +def write_history(x): + import readline: + readline.write_history_file(x) + +atexit.register(write_history)