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
9f366097
Kaydet (Commit)
9f366097
authored
Haz 02, 2003
tarafından
Kurt B. Kaiser
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Modify the remote stack viewer to work in the threaded subprocess.
M PyShell.py M run.py
üst
5da131b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
PyShell.py
Lib/idlelib/PyShell.py
+14
-0
run.py
Lib/idlelib/run.py
+12
-3
No files found.
Lib/idlelib/PyShell.py
Dosyayı görüntüle @
9f366097
...
...
@@ -357,6 +357,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
self
.
rpcclt
.
register
(
"stderr"
,
self
.
tkconsole
.
stderr
)
self
.
rpcclt
.
register
(
"flist"
,
self
.
tkconsole
.
flist
)
self
.
rpcclt
.
register
(
"linecache"
,
linecache
)
self
.
rpcclt
.
register
(
"interp"
,
self
)
self
.
transfer_path
()
self
.
poll_subprocess
()
...
...
@@ -480,6 +481,19 @@ class ModifiedInterpreter(InteractiveInterpreter):
def
getdebugger
(
self
):
return
self
.
debugger
def
open_remote_stack_viewer
(
self
):
"""Initiate the remote stack viewer from a separate thread.
This method is called from the subprocess, and by returning from this
method we allow the subprocess to unblock. After a bit the shell
requests the subprocess to open the remote stack viewer which returns a
static object looking at the last exceptiopn. It is queried through
the RPC mechanism.
"""
self
.
tkconsole
.
text
.
after
(
300
,
self
.
remote_stack_viewer
)
return
def
remote_stack_viewer
(
self
):
import
RemoteObjectBrowser
oid
=
self
.
rpcclt
.
remotequeue
(
"exec"
,
"stackviewer"
,
(
"flist"
,),
{})
...
...
Lib/idlelib/run.py
Dosyayı görüntüle @
9f366097
...
...
@@ -207,9 +207,10 @@ class MyHandler(rpc.RPCHandler):
"""Override base method"""
executive
=
Executive
(
self
)
self
.
register
(
"exec"
,
executive
)
sys
.
stdin
=
self
.
get_remote_proxy
(
"stdin"
)
sys
.
stdin
=
self
.
console
=
self
.
get_remote_proxy
(
"stdin"
)
sys
.
stdout
=
self
.
get_remote_proxy
(
"stdout"
)
sys
.
stderr
=
self
.
get_remote_proxy
(
"stderr"
)
self
.
interp
=
self
.
get_remote_proxy
(
"interp"
)
rpc
.
RPCHandler
.
getresponse
(
self
,
myseq
=
None
,
wait
=
0.05
)
def
exithook
(
self
):
...
...
@@ -238,12 +239,17 @@ class Executive:
def
runcode
(
self
,
code
):
try
:
self
.
usr_exc_info
=
None
exec
code
in
self
.
locals
except
:
self
.
usr_exc_info
=
sys
.
exc_info
()
if
quitting
:
exit
()
# even print a user code SystemExit exception, continue
print_exception
()
jit
=
self
.
rpchandler
.
console
.
getvar
(
"<<toggle-jit-stack-viewer>>"
)
if
jit
:
self
.
rpchandler
.
interp
.
open_remote_stack_viewer
()
else
:
flush_stdout
()
...
...
@@ -261,13 +267,16 @@ class Executive:
return
self
.
calltip
.
fetch_tip
(
name
)
def
stackviewer
(
self
,
flist_oid
=
None
):
if
not
hasattr
(
sys
,
"last_traceback"
):
if
self
.
usr_exc_info
:
typ
,
val
,
tb
=
self
.
usr_exc_info
else
:
return
None
flist
=
None
if
flist_oid
is
not
None
:
flist
=
self
.
rpchandler
.
get_remote_proxy
(
flist_oid
)
tb
=
sys
.
last_traceback
while
tb
and
tb
.
tb_frame
.
f_globals
[
"__name__"
]
in
[
"rpc"
,
"run"
]:
tb
=
tb
.
tb_next
sys
.
last_type
=
typ
sys
.
last_value
=
val
item
=
StackViewer
.
StackTreeItem
(
flist
,
tb
)
return
RemoteObjectBrowser
.
remote_object_tree_item
(
item
)
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