Skip to content

Commit

Permalink
Combine nested with statements into one
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Aug 3, 2023
1 parent ca3fe45 commit 19dc119
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/lsst/daf/butler/datastores/fileDatastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -1332,8 +1332,9 @@ def _read_artifact_into_memory(
formatter.name(),
)
try:
with formatter._updateLocation(newLocation):
with time_this(
with (
formatter._updateLocation(newLocation),
time_this(
log,
msg="Reading%s from location %s %s with formatter %s",
args=(
Expand All @@ -1342,8 +1343,9 @@ def _read_artifact_into_memory(
msg,
formatter.name(),
),
):
result = formatter.read(component=getInfo.component if isComponent else None)
),
):
result = formatter.read(component=getInfo.component if isComponent else None)
except Exception as e:
raise ValueError(
f"Failure from formatter '{formatter.name()}' for dataset {ref.id}"
Expand Down

0 comments on commit 19dc119

Please sign in to comment.