From 89354e152889d5c688de9587e6abff824accaf49 Mon Sep 17 00:00:00 2001 From: pictuga Date: Sat, 8 Jun 2013 17:30:53 +0200 Subject: [PATCH] Use file's built-in readlines() to split file --- morss.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/morss.py b/morss.py index db44b56..70d9b16 100644 --- a/morss.py +++ b/morss.py @@ -117,8 +117,8 @@ class Cache: self._cached = {} # what *was* cached self._cache = {} # new things to put in cache - if os.path.exists(self._file): - data = open(self._file).read().split("\n") + if os.path.isfile(self._file): + data = open(self._file).readlines() for line in data: if "\t" in line: key, bdata = line.split("\t", 1)