Skip to content

Commit 46721d1

Browse files
committed
Revert "Merge pull request #28 from mrocklin/refactor-5"
This reverts commit 79b8f71, reversing changes made to 4682c7d.
1 parent 79b8f71 commit 46721d1

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

zarr/compressors.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import absolute_import, print_function, division
3-
4-
import bz2
53
import zlib
4+
import bz2
5+
66

77
import numpy as np
88

9-
from .compat import text_type
10-
from .util import ensure_bytes
9+
10+
from zarr.compat import text_type
1111

1212

1313
registry = dict()
@@ -122,7 +122,7 @@ def normalize_opts(cls, compression_opts):
122122
cname = cname if cname is not None else cls.default_cname
123123

124124
# check internal compressor is available
125-
if blosc.compname_to_compcode(ensure_bytes(cname)) < 0:
125+
if blosc.compname_to_compcode(cname) < 0:
126126
raise ValueError('blosc internal compressor not available: %s'
127127
% cname)
128128

zarr/util.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,3 @@ def normalize_order(order):
187187
if order not in ['C', 'F']:
188188
raise ValueError("order must be either 'C' or 'F', found: %r" % order)
189189
return order
190-
191-
192-
def ensure_bytes(s):
193-
if hasattr(s, 'encode'):
194-
return s.encode()
195-
else:
196-
return s

0 commit comments

Comments
 (0)