# HG changeset patch # User Daniel O'Connor # Date 1316582815 -34200 # Node ID c6be52360c2fe61314ee843ae762bfc315bf2b29 # Parent e2833d081413e88bb2dd3ef6f2ba8cb21b497e53 Handle default port better so passing None in picks the default. diff -r e2833d081413 -r c6be52360c2f scpisock.py --- 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):