From 4dc067e553e5c4312e00dba8ee38b920ea79ed8b Mon Sep 17 00:00:00 2001 From: Viktor Stanchev Date: Sat, 2 Jul 2016 14:05:18 -0700 Subject: [PATCH] fix unclosed file warning --- pirate/local.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pirate/local.py b/pirate/local.py index 8163539..2169143 100644 --- a/pirate/local.py +++ b/pirate/local.py @@ -31,7 +31,9 @@ class BayParser(parser.HTMLParser): def search(db, terms): - xml = open(db).readlines() + f = open(db) + xml = f.readlines() + f.close() parser = BayParser() parser.q = (' '.join(terms)).lower() parser.feed(''.join(xml))