diff options
author | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2009-10-26 23:57:48 +0000 |
---|---|---|
committer | cliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a> | 2009-10-26 23:57:48 +0000 |
commit | 450807400aefbf624e31d77836217d58fd66fb39 (patch) | |
tree | a3c25c95b498e8a8f568942e7376873cf9ce6570 | |
parent | 0726e1ee3f218d0eb95bb278e0e6b4a10fa16b24 (diff) | |
download | pyserial-450807400aefbf624e31d77836217d58fd66fb39.tar.gz |
bugfix 2886763
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@349 f19166aa-fa4f-0410-85c2-fa1106f25c8a
-rw-r--r-- | CHANGES.txt | 1 | ||||
-rw-r--r-- | serial/serialwin32.py | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 6b28b6e..83795f9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -334,3 +334,4 @@ Bugfixes (win32): - [SF 2446218] outWaiting implemented - [Bug 2392892] scanwin32.py better exception handling - [Bug 2505422] scanwin32.py Vista 64bit compatibility +- [Bug 2886763] hComPort doesn't get initialized for Serial(port=None) diff --git a/serial/serialwin32.py b/serial/serialwin32.py index af436bb..7bd4bbd 100644 --- a/serial/serialwin32.py +++ b/serial/serialwin32.py @@ -25,12 +25,15 @@ class Win32Serial(SerialBase): BAUDRATES = (50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200) + def __init__(self, *args, **kwargs): + self.hComPort = None + SerialBase.__init__(self, *args, **kwargs) + def open(self): """Open port with current settings. This may throw a SerialException if the port cannot be opened.""" if self._port is None: raise SerialException("Port must be configured before it can be used.") - self.hComPort = None # the "\\.\COMx" format is required for devices other than COM1-COM8 # not all versions of windows seem to support this properly # so that the first few ports are used with the DOS device name |