From f16cd9c5980d3af25b639212384945486a5326a3 Mon Sep 17 00:00:00 2001 From: KerstinKeller Date: Tue, 1 Oct 2024 13:47:53 +0200 Subject: [PATCH] [python] Fix iterating over measurement which was broken by fe84826 (#1748) (#1750) --- lang/python/ecalhdf5/ecal/measurement/measurement.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lang/python/ecalhdf5/ecal/measurement/measurement.py b/lang/python/ecalhdf5/ecal/measurement/measurement.py index fd230bdd25..720b5dda8c 100644 --- a/lang/python/ecalhdf5/ecal/measurement/measurement.py +++ b/lang/python/ecalhdf5/ecal/measurement/measurement.py @@ -1,6 +1,6 @@ # ========================= eCAL LICENSE ================================= # -# Copyright (C) 2016 - 2019 Continental Corporation +# Copyright (C) 2016 - 2024 Continental Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -191,8 +191,9 @@ def __init__(self, measurement, channel_type): self._measurement = measurement self._iterator = iter(measurement.channel_names) self._channel_type = channel_type + def __next__(self): - return self._channel_type(self._measurement, self._iterator.next()) + return self._channel_type(self._measurement, self._iterator.__next__()) def next(self): return self.__next__() @@ -212,7 +213,7 @@ def __getitem__(self, channel_name): return self._channel_type(self, channel_name) def __iter__(self): - return Measurement.Iterator(self) + return Measurement.Iterator(self, self._channel_type) def __repr__(self): return "< Measurement object: path: %s - number of channels: %i >" % (self._path, len(self.channel_names))