From 9d083fb550ccf59181a6e154b3d964b573314aee Mon Sep 17 00:00:00 2001 From: Bill Dengler Date: Sat, 2 May 2015 03:53:20 -0400 Subject: [PATCH] Fixed error handling. --- src/sessionmanager/session.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sessionmanager/session.py b/src/sessionmanager/session.py index bc8317b5..58545fae 100644 --- a/src/sessionmanager/session.py +++ b/src/sessionmanager/session.py @@ -367,9 +367,9 @@ class Session(object): try: shelf=shelve.open(paths.config_path(shelfname),'c') for key,value in self.db.items(): - if type(key) != str or type(key) != unicode: - output.speak("Uh oh, while shelving the database, a key of type " + type(key) + " has been found. It will be converted to type str, but this will cause all sorts of problems on deshelve. Please bring this to the attention of the " + application.name + " developers immediately. More information about the error will be written to the error log.") - log.error("Uh oh, " + str(key) + " is of type " + type(key) + "!") + if type(key) != str and type(key) != unicode: + output.speak("Uh oh, while shelving the database, a key of type " + str(type(key)) + " has been found. It will be converted to type str, but this will cause all sorts of problems on deshelve. Please bring this to the attention of the " + application.name + " developers immediately. More information about the error will be written to the error log.") + log.error("Uh oh, " + str(key) + " is of type " + str(type(key)) + "!") shelf[str(key)]=value shelf.close() except: