Skip to content

Commit

Permalink
Use max_header_size param only for numpy >= 1.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ptormene committed Oct 11, 2023
1 parent a47ba11 commit c94f5f7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions svir/tasks/extract_npz_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,13 @@ def run(self):
"%s: returned an empty content" % err_msg))
return
try:
extracted_npz = numpy.load(
io.BytesIO(resp.content), allow_pickle=False,
max_header_size=100000)
if numpy.__version__ >= '1.24.0':
extracted_npz = numpy.load(
io.BytesIO(resp.content), allow_pickle=False,
max_header_size=100000)
else:
extracted_npz = numpy.load(
io.BytesIO(resp.content), allow_pickle=False)
except Exception as exc:
self.exception_sig.emit(exc)
return
Expand Down

0 comments on commit c94f5f7

Please sign in to comment.