Skip to content

Commit

Permalink
[python] Fix iterating over measurement which was broken by fe84826 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
KerstinKeller committed Oct 1, 2024
1 parent c2943a7 commit 1b06740
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lang/python/ecalhdf5/ecal/measurement/measurement.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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__()
Expand All @@ -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))
Expand Down

0 comments on commit 1b06740

Please sign in to comment.