Commit 6af6747b authored by okhin's avatar okhin
Browse files

Let's use a for … in … instead of a with … as …

parent c271b573
......@@ -149,7 +149,7 @@ def sanitize_phonenumber(number):
# We're checking if we're blacklisted
db = sqlite3.connect(config['piphone']['db'])
bl_re = None
with db.execute('SELECT pattern, reason FROM blacklist').fetchall() as blacklist:
for blacklist in db.execute('SELECT pattern, reason FROM blacklist').fetchall():
if bl_re == None:
bl_re ='(?P<{reason}>^{pattern})'.format(pattern=blacklist[0],reason=blacklist[1],)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment