File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -722,6 +722,23 @@ def cd(self):
722722 raise portNotOpenError
723723 return bool (self .get_modem_state () & MODEMSTATE_MASK_CD )
724724
725+ @property
726+ def timeout (self ):
727+ """Get the current timeout setting."""
728+ return self ._timeout
729+
730+ @timeout .setter
731+ def timeout (self , timeout ):
732+ """Change timeout setting."""
733+ if timeout is not None :
734+ try :
735+ timeout + 1 # test if it's a number, will throw a TypeError if not...
736+ except TypeError :
737+ raise ValueError ("Not a valid timeout: {!r}" .format (timeout ))
738+ if timeout < 0 :
739+ raise ValueError ("Not a valid timeout: {!r}" .format (timeout ))
740+ self ._timeout = timeout
741+
725742 # - - - platform specific - - -
726743 # None so far
727744
You can’t perform that action at this time.
0 commit comments