changeset 28:c6be52360c2f

Handle default port better so passing None in picks the default.
author Daniel O'Connor <darius@dons.net.au>
date Wed, 21 Sep 2011 14:56:55 +0930
parents e2833d081413
children 12b6a3a0a481
files scpisock.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scpisock.py	Wed Sep 21 14:56:21 2011 +0930
+++ b/scpisock.py	Wed Sep 21 14:56:55 2011 +0930
@@ -36,7 +36,9 @@
 SCPI_PORT = 5025
 
 class SCPISockDevice(object):
-    def __init__(self, host, port = SCPI_PORT):
+    def __init__(self, host, port = None):
+        if port == None:
+            port = SCPI_PORT
         self.sock = socket.create_connection((host, port))
 
     def flush(self):