Browse Source

Code cleaning

Roland Haroutiounian 8 years ago
parent
commit
cb3d0ea8db
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      plugins/filesystem_session/filesystem_session_store.py

+ 3
- 1
plugins/filesystem_session/filesystem_session_store.py View File

@@ -43,7 +43,9 @@ class FileSystemSessionStore(SessionStore):
43 43
     # @param session dict : content to be saved
44 44
     def save_session(self, sid, session):
45 45
         session_file_path = self.get_session_file_path(sid)
46
-        pickle.dump(session, open(session_file_path, "wb"))
46
+        with open(session_file_path, 'wb') as session_file:
47
+            pickle.dump(session, session_file)
48
+
47 49
 
48 50
     # === UTILS === #
49 51
     ## @brief returns the session id from the filename

Loading…
Cancel
Save