Skip to content

Commit

Permalink
- avoid resource leak
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed May 19, 2022
1 parent 49cf40a commit 0be140b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion basico/task_parameterestimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ def get_data_from_experiment(experiment, **kwargs):
"""
experiment = get_experiment(experiment, **kwargs)
experiment_file = _get_experiment_file(experiment)
num_lines = sum(1 for _ in open(experiment_file))
with open(experiment_file) as f:
num_lines = sum(1 for _ in f)
header_row = experiment.getHeaderRow()
have_headers = header_row < num_lines
skip_idx = [x-1 for x in range(1, num_lines+1) if
Expand Down

0 comments on commit 0be140b

Please sign in to comment.