[bugfix] File wasn't closed explicitly, add implicit close by with statement

This commit is contained in:
Darius Arnold 2018-11-30 11:20:47 +01:00
parent 6afb61b666
commit 3abeabc75c

View File

@ -3475,7 +3475,7 @@ class Project(object):
File structure (each row): event, date, time, magnitude, latitude, longitude, depth
separated by :param:separator each.
'''
infile = open(filename, 'r')
with open(filename, 'r') as infile:
for line in infile.readlines():
eventID, date, time, mag, lat, lon, depth = line.split(separator)[:7]
# skip first line