1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-10 10:04:21 +01:00

Merge pull request #85 from vikstrous/fix-unclosed-file

fix unclosed file warning
This commit is contained in:
Michele Guerini Rocco 2016-07-07 01:02:15 +02:00 committed by GitHub
commit 06bf8ed713

View File

@ -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))