Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
24d7e0cb
Kaydet (Commit)
24d7e0cb
authored
Haz 05, 2003
tarafından
Kurt B. Kaiser
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avoid problem resolving 'localhost'
M PyShell.py M rpc.py M run.py
üst
852f35bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
PyShell.py
Lib/idlelib/PyShell.py
+2
-1
rpc.py
Lib/idlelib/rpc.py
+3
-2
run.py
Lib/idlelib/run.py
+3
-1
No files found.
Lib/idlelib/PyShell.py
Dosyayı görüntüle @
24d7e0cb
...
@@ -35,6 +35,7 @@ import Debugger
...
@@ -35,6 +35,7 @@ import Debugger
import
RemoteDebugger
import
RemoteDebugger
IDENTCHARS
=
string
.
ascii_letters
+
string
.
digits
+
"_"
IDENTCHARS
=
string
.
ascii_letters
+
string
.
digits
+
"_"
LOCALHOST
=
'127.0.0.1'
try
:
try
:
from
signal
import
SIGTERM
from
signal
import
SIGTERM
...
@@ -336,7 +337,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
...
@@ -336,7 +337,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
return
[
sys
.
executable
]
+
w
+
[
"-c"
,
command
,
str
(
self
.
port
)]
return
[
sys
.
executable
]
+
w
+
[
"-c"
,
command
,
str
(
self
.
port
)]
def
start_subprocess
(
self
):
def
start_subprocess
(
self
):
addr
=
(
"localhost"
,
self
.
port
)
addr
=
(
LOCALHOST
,
self
.
port
)
# Idle starts listening for connection on localhost
# Idle starts listening for connection on localhost
for
i
in
range
(
3
):
for
i
in
range
(
3
):
time
.
sleep
(
i
)
time
.
sleep
(
i
)
...
...
Lib/idlelib/rpc.py
Dosyayı görüntüle @
24d7e0cb
...
@@ -64,6 +64,7 @@ copy_reg.pickle(types.CodeType, pickle_code, unpickle_code)
...
@@ -64,6 +64,7 @@ copy_reg.pickle(types.CodeType, pickle_code, unpickle_code)
# copy_reg.pickle(types.FunctionType, pickle_function, unpickle_function)
# copy_reg.pickle(types.FunctionType, pickle_function, unpickle_function)
BUFSIZE
=
8
*
1024
BUFSIZE
=
8
*
1024
LOCALHOST
=
'127.0.0.1'
class
RPCServer
(
SocketServer
.
TCPServer
):
class
RPCServer
(
SocketServer
.
TCPServer
):
...
@@ -525,7 +526,7 @@ class RPCClient(SocketIO):
...
@@ -525,7 +526,7 @@ class RPCClient(SocketIO):
working_sock
,
address
=
self
.
listening_sock
.
accept
()
working_sock
,
address
=
self
.
listening_sock
.
accept
()
if
self
.
debugging
:
if
self
.
debugging
:
print
>>
sys
.
__stderr__
,
"****** Connection request from "
,
address
print
>>
sys
.
__stderr__
,
"****** Connection request from "
,
address
if
address
[
0
]
==
'127.0.0.1'
:
if
address
[
0
]
==
LOCALHOST
:
SocketIO
.
__init__
(
self
,
working_sock
)
SocketIO
.
__init__
(
self
,
working_sock
)
else
:
else
:
print
>>
sys
.
__stderr__
,
"** Invalid host: "
,
address
print
>>
sys
.
__stderr__
,
"** Invalid host: "
,
address
...
@@ -655,7 +656,7 @@ def testClient(addr):
...
@@ -655,7 +656,7 @@ def testClient(addr):
# clt.remotecall("thomas","greet_this_guy",("alexander",), {})
# clt.remotecall("thomas","greet_this_guy",("alexander",), {})
def
test
():
def
test
():
addr
=
(
"localhost"
,
8833
)
addr
=
(
LOCALHOST
,
8833
)
if
len
(
sys
.
argv
)
==
2
:
if
len
(
sys
.
argv
)
==
2
:
if
sys
.
argv
[
1
]
==
'-server'
:
if
sys
.
argv
[
1
]
==
'-server'
:
testServer
(
addr
)
testServer
(
addr
)
...
...
Lib/idlelib/run.py
Dosyayı görüntüle @
24d7e0cb
...
@@ -17,6 +17,8 @@ import interrupt
...
@@ -17,6 +17,8 @@ import interrupt
import
__main__
import
__main__
LOCALHOST
=
'127.0.0.1'
# Thread shared globals: Establish a queue between a subthread (which handles
# Thread shared globals: Establish a queue between a subthread (which handles
# the socket) and the main thread (which runs user code), plus global
# the socket) and the main thread (which runs user code), plus global
# completion and exit flags:
# completion and exit flags:
...
@@ -52,7 +54,7 @@ def main(del_exitfunc=False):
...
@@ -52,7 +54,7 @@ def main(del_exitfunc=False):
sys
.
argv
[:]
=
[
""
]
sys
.
argv
[:]
=
[
""
]
sockthread
=
threading
.
Thread
(
target
=
manage_socket
,
sockthread
=
threading
.
Thread
(
target
=
manage_socket
,
name
=
'SockThread'
,
name
=
'SockThread'
,
args
=
((
'localhost'
,
port
),))
args
=
((
LOCALHOST
,
port
),))
sockthread
.
setDaemon
(
True
)
sockthread
.
setDaemon
(
True
)
sockthread
.
start
()
sockthread
.
start
()
while
1
:
while
1
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment