Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tomotools
tomoscan
Commits
d520e59c
Commit
d520e59c
authored
Oct 13, 2020
by
payno
Browse files
[io] reset previous value of `HDF5_USE_FILE_LOCKING`
parent
f4e71e86
Pipeline
#35161
passed with stages
in 11 minutes and 1 second
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tomoscan/io.py
View file @
d520e59c
...
...
@@ -67,6 +67,7 @@ class HDF5File(h5py.File):
kwargs
[
"libver"
]
=
"latest"
if
enable_file_locking
is
None
:
enable_file_locking
=
mode
!=
"r"
old_file_locking
=
os
.
environ
.
get
(
"HDF5_USE_FILE_LOCKING"
,
None
)
if
enable_file_locking
:
os
.
environ
[
"HDF5_USE_FILE_LOCKING"
]
=
"TRUE"
else
:
...
...
@@ -95,6 +96,10 @@ class HDF5File(h5py.File):
else
:
kwargs
[
"libver"
]
=
libver
super
().
__init__
(
filename
,
mode
=
mode
,
swmr
=
swmr
,
**
kwargs
)
if
old_file_locking
is
None
:
del
os
.
environ
[
"HDF5_USE_FILE_LOCKING"
]
else
:
os
.
environ
[
"HDF5_USE_FILE_LOCKING"
]
=
old_file_locking
@
contextmanager
def
_protect_init
(
self
,
filename
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment