summaryrefslogtreecommitdiffstats
path: root/Demo/sockets/gopher.py
diff options
context:
space:
mode:
Diffstat (limited to 'Demo/sockets/gopher.py')
-rwxr-xr-xDemo/sockets/gopher.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Demo/sockets/gopher.py b/Demo/sockets/gopher.py
index d06c78a..625697b 100755
--- a/Demo/sockets/gopher.py
+++ b/Demo/sockets/gopher.py
@@ -39,7 +39,9 @@ TAB = '\t'
# Open a TCP connection to a given host and port
def open_socket(host, port):
- if type(port) == type(''):
+ if not port:
+ port = DEF_PORT
+ elif type(port) == type(''):
port = string.atoi(port)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))