[kupfer] learn: Don't write an empty register
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] learn: Don't write an empty register
- Date: Tue, 25 Aug 2009 13:22:54 +0000 (UTC)
commit 693bde0f8dbd0e70bade88cdb9dda97b8df45747
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Tue Aug 25 13:24:46 2009 +0200
learn: Don't write an empty register
The empty register might overwrite a good register that we didn't load
if we had an exception at program launch.
kupfer/learn.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/learn.py b/kupfer/learn.py
index d1ecae6..2d2a0a9 100644
--- a/kupfer/learn.py
+++ b/kupfer/learn.py
@@ -98,5 +98,8 @@ def finish():
"""
Close and save the learning record
"""
+ if not _register:
+ pretty.print_debug(__name__, "Not writing empty register")
+ return
filepath = config.save_data_file(mnemonics_filename)
Learning._pickle_register(_register, filepath)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]