File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -85,5 +85,6 @@ def get_pin(self, pin):
85
85
"""Convenience function to create an instance of the DigitalInOut class
86
86
pointing at the specified pin of this MCP23008 device.
87
87
"""
88
- assert 0 <= pin <= 7
88
+ if not 0 <= pin <= 7 :
89
+ raise ValueError ("Pin number must be 0-7." )
89
90
return DigitalInOut (pin , self )
Original file line number Diff line number Diff line change @@ -126,7 +126,8 @@ def get_pin(self, pin):
126
126
"""Convenience function to create an instance of the DigitalInOut class
127
127
pointing at the specified pin of this MCP23016 device.
128
128
"""
129
- assert 0 <= pin <= 15
129
+ if not 0 <= pin <= 15 :
130
+ raise ValueError ("Pin number must be 0-15." )
130
131
return DigitalInOut (pin , self )
131
132
132
133
def clear_inta (self ):
Original file line number Diff line number Diff line change @@ -163,7 +163,8 @@ def get_pin(self, pin):
163
163
"""Convenience function to create an instance of the DigitalInOut class
164
164
pointing at the specified pin of this MCP23017 device.
165
165
"""
166
- assert 0 <= pin <= 15
166
+ if not 0 <= pin <= 15 :
167
+ raise ValueError ("Pin number must be 0-15." )
167
168
return DigitalInOut (pin , self )
168
169
169
170
@property
You can’t perform that action at this time.
0 commit comments