Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions drishti/includes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ def load_json():
codes = []
if not args.split_files:
if args.json:
f = open(args.json)
data = json.load(f)
with open(args.json, encoding='utf-8') as f:
data = json.load(f)

for key, values in data.items():
for value in values:
Expand All @@ -169,8 +169,8 @@ def validate_thresholds():
Validate thresholds defined by the user.
"""
if args.config:
f = open(args.config)
data = json.load(f)
with open(args.config, encoding='utf-8') as f:
data = json.load(f)

for category, thresholds_spec in data.items():
for threshold_name, threshold_value in thresholds_spec.items():
Expand Down