Skip to content

Commit 7ff48b1

Browse files
committed
p402: Remove return value from property setter.
Such a return value cannot be used sensibly, because assignments to the property don't have a return value in Python.
1 parent adc15da commit 7ff48b1

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

canopen/profiles/p402.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,6 @@ def op_mode(self):
343343
def op_mode(self, mode):
344344
"""Function to define the operation mode of the node
345345
:param string mode: Mode to define.
346-
:return: Return if the operation mode was set with success or not
347-
:rtype: bool
348346
349347
The modes can be:
350348
- 'NO MODE'
@@ -381,15 +379,13 @@ def op_mode(self, mode):
381379
raise RuntimeError(
382380
"Timeout setting node {0}'s new mode of operation to {1}.".format(
383381
self.id, mode))
384-
return True
385382
except SdoCommunicationError as e:
386383
logger.warning('[SDO communication error] Cause: {0}'.format(str(e)))
387384
except (RuntimeError, ValueError) as e:
388385
logger.warning('{0}'.format(str(e)))
389386
finally:
390387
self.state = start_state # why?
391388
logger.info('Set node {n} operation mode to {m}.'.format(n=self.id, m=mode))
392-
return False
393389

394390
def _clear_target_values(self):
395391
# [target velocity, target position, target torque]

0 commit comments

Comments
 (0)