diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2011-03-19 00:22:32 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2011-03-19 00:22:32 +0000 |
commit | 70bf90432545b0583dde309aea507fa773f2d143 (patch) | |
tree | 5a450c91748efab2068067556beefb511a02218e /serial/serialjava.py | |
parent | e75f543f968817c02446bc84ec8c15c64d396adf (diff) | |
download | pyserial-70bf90432545b0583dde309aea507fa773f2d143.tar.gz |
related to SF 3093882, raise an exception when open() is called twice, also add unit test for this
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@392 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'serial/serialjava.py')
-rw-r--r-- | serial/serialjava.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/serial/serialjava.py b/serial/serialjava.py index 2541534..1993ee9 100644 --- a/serial/serialjava.py +++ b/serial/serialjava.py @@ -58,6 +58,8 @@ class JavaSerial(SerialBase): if the port cannot be opened.""" if self._port is None: raise SerialException("Port must be configured before it can be used.") + if self._isOpen: + raise SerialException("Port is already open.") if type(self._port) == type(''): # strings are taken directly portId = comm.CommPortIdentifier.getPortIdentifier(self._port) else: |