Skip to content

Commit

Permalink
fix subscript value in browse expression
Browse files Browse the repository at this point in the history
probably regression from python 3.10 in base image
  • Loading branch information
Lubomir Dolezal committed Sep 8, 2022
1 parent a325b28 commit 970fb79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eoxserver/render/browse/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,10 @@ def _evaluate_expression(expr, fields_and_datasets, variables, cache):
expr.value, fields_and_datasets, variables, cache
)
# assume that we will only use a single index
slice_ = expr.slice.value.value
if isinstance(expr.slice.value, int):
slice_ = expr.slice.value # python 3.10
else:
slice_ = expr.slice.value.value # python 3.8

# Get a copy of the selected band
data = value.GetRasterBand(slice_ + 1).ReadAsArray()
Expand Down

0 comments on commit 970fb79

Please sign in to comment.