Skip to content

Commit

Permalink
fix: Fix bug with referencing an out of scope variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rsavoye committed Nov 8, 2023
1 parent 7de0f6a commit 40bd40c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion osm_fieldwork/basemapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def dlthread(
# Create the subdirectories as pySmartDL doesn't do it for us
Path(dest).mkdir(parents=True, exist_ok=True)

dl = None
try:
if site["source"] == "topo":
filespec += "." + site["suffix"]
Expand All @@ -112,7 +113,10 @@ def dlthread(
log.debug("%s exists!" % (outfile))
except Exception as e:
log.error(e)
log.error("Couldn't download from %r: %s" % (filespec, dl.get_errors()))
if dl:
log.error(f"Couldn't download {filespec}: {dl.get_errors()}")
else:
log.error(f"Couldn't download {filespec}")


class BaseMapper(object):
Expand Down

0 comments on commit 40bd40c

Please sign in to comment.