Skip to content

Commit

Permalink
Open file with context manager
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Sep 4, 2022
1 parent c152b34 commit b482ba6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/stravavis/process_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def process_file(fpath):
# Function for processing an individual GPX file
# Ref: https://pypi.org/project/gpxpy/
def process_gpx(gpxfile):
activity = gpxpy.parse(open(gpxfile, encoding="utf-8"))
with open(gpxfile, encoding="utf-8") as f:
activity = gpxpy.parse(f)

lon = []
lat = []
Expand Down

0 comments on commit b482ba6

Please sign in to comment.