Skip to content

Commit b164d23

Browse files
committed
isascii only exist on python 3.7+
1 parent d45a793 commit b164d23

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

zarr/v3/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import json
88
import os
9+
import sys
910
from collections.abc import MutableMapping
1011
from pathlib import Path
1112
from string import ascii_letters, digits
@@ -44,8 +45,9 @@ def _valid_path(key: str) -> bool:
4445
user, and is a store implmentation detail, so thie method will raise
4546
a ValueError in that case.
4647
"""
47-
if not key.isascii():
48-
return False
48+
if sys.version_info() > (3, 7):
49+
if not key.isascii():
50+
return False
4951
if set(key) - set(ascii_letters + digits + "/.-_"):
5052
return False
5153

0 commit comments

Comments
 (0)