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
177dd807
Kaydet (Commit)
177dd807
authored
Ock 24, 1992
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Experimental version writes the command to a file.
üst
babe2bf8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
bdb.py
Lib/bdb.py
+15
-3
No files found.
Lib/bdb.py
Dosyayı görüntüle @
177dd807
...
...
@@ -6,6 +6,7 @@
# and 'wdb', a window-oriented debugger.
# And of course... you can roll your own!
import
sys
BdbQuit
=
'bdb.BdbQuit'
# Exception to give up completely
...
...
@@ -220,9 +221,8 @@ class Bdb: # Basic Debugger
# a debugger to debug a statement, given as a string.
def
run
(
self
,
cmd
):
import
__main__
dict
=
__main__
.
__dict__
self
.
runctx
(
cmd
,
dict
,
dict
)
modname
=
self
.
writetempfile
(
cmd
)
self
.
runctx
(
'import '
+
modname
+
'
\n
'
,
{},
{})
def
runctx
(
self
,
cmd
,
globals
,
locals
):
self
.
reset
()
...
...
@@ -237,6 +237,18 @@ class Bdb: # Basic Debugger
del
sys
.
trace
# XXX What to do if the command finishes normally?
def
writetempfile
(
self
,
cmd
):
import
os
modname
=
'bdb'
+
`os.getpid()`
filename
=
'/tmp/'
+
modname
+
'.py'
f
=
open
(
filename
,
'w'
)
f
.
write
(
cmd
+
'
\n
'
)
f
.
close
()
import
sys
if
sys
.
modules
.
has_key
(
modname
):
del
sys
.
modules
[
modname
]
if
'/tmp'
not
in
sys
.
path
:
sys
.
path
.
insert
(
0
,
'/tmp'
)
return
modname
# -------------------- testing --------------------
...
...
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