Review existing comments and add new ones

Also clarified a statement
This commit is contained in:
JoeLametta
2019-01-17 11:25:16 +00:00
parent fe36241730
commit cf923cc9cc
11 changed files with 18 additions and 5 deletions

View File

@@ -104,8 +104,8 @@ class Persister:
try:
self.object = pickle.load(handle)
logger.debug('loaded persisted object from %r', self._path)
# FIXME: catching too general exception (Exception)
except Exception as e:
# TODO: restrict kind of caught exceptions?
# can fail for various reasons; in that case, pretend we didn't
# load it
logger.debug(e)
@@ -127,7 +127,7 @@ class PersistedCache:
try:
os.makedirs(self.path)
except OSError as e:
if e.errno != 17: # FIXME
if e.errno != os.errno.EEXIST: # FIXME: errno 17 is 'File Exists'
raise
def _getPath(self, key):