Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin committed Nov 16, 2021
1 parent c1d23ce commit c8079ea
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions WDL/StdLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import tempfile
from typing import List, Tuple, Callable, BinaryIO, Optional
from abc import ABC, abstractmethod
from contextlib import suppress
import regex
from . import Type, Value, Expr, Env, Error
from ._util import byte_size_units, chmod_R_plus
Expand Down Expand Up @@ -469,11 +470,9 @@ def _call_eager(self, expr: "Expr.Apply", arguments: List[Value.Base]) -> Value.
# allow member access from read_json() (issue #320)
key = None
if rhs.type.coerces(Type.String()):
try:
with suppress(Error.RuntimeError):
key = rhs.coerce(Type.String()).value
except Error.RuntimeError:
pass
if not key or key not in lhs.value:
if key is None or key not in lhs.value:
raise Error.OutOfBounds(expr.arguments[1], "struct member not found")
return lhs.value[key]
else:
Expand Down

0 comments on commit c8079ea

Please sign in to comment.