Skip to content

Commit 77e22e0

Browse files
committed
narrow exception types
1 parent 5e0d35b commit 77e22e0

File tree

1 file changed

+2
-1
lines changed
  • src/zarr/core/metadata

1 file changed

+2
-1
lines changed

src/zarr/core/metadata/v2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import base64
4+
import binascii
45
from collections.abc import Iterable
56
from enum import Enum
67
from typing import TYPE_CHECKING, cast
@@ -150,7 +151,7 @@ def from_dict(cls, data: dict[str, Any]) -> ArrayV2Metadata:
150151
try:
151152
fill_value = base64.standard_b64decode(fill_value_encoded)
152153
_data["fill_value"] = fill_value
153-
except Exception:
154+
except (TypeError, binascii.Error, ValueError):
154155
# be lenient, allow for other values that may have been used before base64
155156
# encoding and may work as fill values, e.g., the number 0
156157
pass

0 commit comments

Comments
 (0)