Skip to content

Commit d23853b

Browse files
authored
Merge pull request #93 from tomwhite/lambda-init
Run on lambda
2 parents 932a912 + 3ef5e57 commit d23853b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

docs/release.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ Release notes
1818
* Updated the msgpack dependency (by :user:`Jerome Kelleher <jeromekelleher>`;
1919
:issue:`74`, :issue:`75`).
2020

21-
* Allow :class:`Blosc` compressor to run on systems where locks are not present (by
22-
:user:`Marcus Kinsella <mckinsel>`; :issue:`#83`).
21+
* Allow :class:`Blosc` compressor to run on systems where locks are not present (by
22+
:user:`Marcus Kinsella <mckinsel>`, :issue:`83`; and :user:`Tom White <tomwhite>`,
23+
:issue:`93`).
2324

2425
* Drop Python 3.4 (by :user:`John Kirkham <jakirkham>`; :issue:`89`).
2526

@@ -61,7 +62,7 @@ Release notes
6162

6263
* Add support for encoding None values in VLen... codecs (:issue:`59`).
6364

64-
65+
6566
.. _release_0.5.1:
6667

6768
0.5.1

numcodecs/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@
4444
from numcodecs.blosc import Blosc
4545
register_codec(Blosc)
4646
# initialize blosc
47-
ncores = multiprocessing.cpu_count()
47+
try:
48+
ncores = multiprocessing.cpu_count()
49+
except OSError:
50+
ncores = 1
4851
blosc.init()
4952
blosc.set_nthreads(min(8, ncores))
5053
atexit.register(blosc.destroy)

0 commit comments

Comments
 (0)