mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 05:58:25 +00:00
python: Migrate open statements to use with.
This is low priority, but it's nice to be consistently using the best practice pattern. Fixes: #12419.
This commit is contained in:
@@ -14,7 +14,8 @@ def nagios_from_file(results_file):
|
||||
This file is created by various nagios checking cron jobs such as
|
||||
check-rabbitmq-queues and check-rabbitmq-consumers"""
|
||||
|
||||
data = open(results_file).read().strip()
|
||||
with open(results_file) as f:
|
||||
data = f.read().strip()
|
||||
pieces = data.split('|')
|
||||
|
||||
if not len(pieces) == 4:
|
||||
|
||||
Reference in New Issue
Block a user