Skip to content

Commit

Permalink
Merge pull request #25 from TEParsons/main-bf-device-profile
Browse files Browse the repository at this point in the history
BF: Fix `getDeviceProfile` so it no longer returns unusable keys
  • Loading branch information
TEParsons authored Jan 22, 2025
2 parents 560a36e + a264543 commit 9f69b1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions psychopy_cedrus/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def isSameDevice(self, other):
other = other.parent
elif isinstance(other, dict) and "pad" in other:
# if given a dict, make sure we have an `index` rather than a `pad`
other = other.copy()
other['index'] = other.pop('pad')
# use parent's comparison method
return self.parent.isSameDevice(other)
Expand Down Expand Up @@ -392,6 +393,7 @@ def isSameDevice(self, other):
other = other.parent
elif isinstance(other, dict) and "pad" in other:
# if given a dict, make sure we have an `index` rather than a `pad`
other = other.copy()
other['index'] = other.pop('pad')
# use parent's comparison method
return self.parent.isSameDevice(other)
Expand Down Expand Up @@ -509,6 +511,7 @@ def isSameDevice(self, other):
other = other.parent
elif isinstance(other, dict) and "pad" in other:
# if given a dict, make sure we have an `index` rather than a `pad`
other = other.copy()
other['index'] = other.pop('pad')
# use parent's comparison method
return self.parent.isSameDevice(other)
Expand Down

0 comments on commit 9f69b1f

Please sign in to comment.