diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2003-06-05 23:51:29 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2003-06-05 23:51:29 (GMT) |
commit | 24d7e0cbb8b978738f223d4bb6cb184054d72e18 (patch) | |
tree | 48e8e80b4edc93165a001f78dd4662e23c710937 /Lib/idlelib/rpc.py | |
parent | 852f35bbeb23d898fb0d16489effb1197ee3fe02 (diff) | |
download | cpython-24d7e0cbb8b978738f223d4bb6cb184054d72e18.zip cpython-24d7e0cbb8b978738f223d4bb6cb184054d72e18.tar.gz cpython-24d7e0cbb8b978738f223d4bb6cb184054d72e18.tar.bz2 |
Avoid problem resolving 'localhost'
M PyShell.py
M rpc.py
M run.py
Diffstat (limited to 'Lib/idlelib/rpc.py')
-rw-r--r-- | Lib/idlelib/rpc.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py index 658aaf3..63e0ffa 100644 --- a/Lib/idlelib/rpc.py +++ b/Lib/idlelib/rpc.py @@ -64,6 +64,7 @@ copy_reg.pickle(types.CodeType, pickle_code, unpickle_code) # copy_reg.pickle(types.FunctionType, pickle_function, unpickle_function) BUFSIZE = 8*1024 +LOCALHOST = '127.0.0.1' class RPCServer(SocketServer.TCPServer): @@ -525,7 +526,7 @@ class RPCClient(SocketIO): working_sock, address = self.listening_sock.accept() if self.debugging: print>>sys.__stderr__, "****** Connection request from ", address - if address[0] == '127.0.0.1': + if address[0] == LOCALHOST: SocketIO.__init__(self, working_sock) else: print>>sys.__stderr__, "** Invalid host: ", address @@ -655,7 +656,7 @@ def testClient(addr): # clt.remotecall("thomas","greet_this_guy",("alexander",), {}) def test(): - addr=("localhost",8833) + addr=(LOCALHOST, 8833) if len(sys.argv) == 2: if sys.argv[1]=='-server': testServer(addr) |