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
23ae488f
Kaydet (Commit)
23ae488f
authored
Eyl 05, 2015
tarafından
Terry Jan Reedy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #16180: Exit pdb if file has syntax error, instead of trapping user
in an infinite loop. Patch by Xavier de Gaye.
üst
bda9bd1d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
pdb.py
Lib/pdb.py
+3
-0
test_pdb.py
Lib/test/test_pdb.py
+11
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/pdb.py
Dosyayı görüntüle @
23ae488f
...
...
@@ -1322,6 +1322,9 @@ def main():
# In most cases SystemExit does not warrant a post-mortem session.
print
"The program exited via sys.exit(). Exit status: "
,
print
sys
.
exc_info
()[
1
]
except
SyntaxError
:
traceback
.
print_exc
()
sys
.
exit
(
1
)
except
:
traceback
.
print_exc
()
print
"Uncaught exception. Entering post mortem debugging"
...
...
Lib/test/test_pdb.py
Dosyayı görüntüle @
23ae488f
...
...
@@ -69,6 +69,17 @@ class PdbTestCase(unittest.TestCase):
any
(
'main.py(5)foo()->None'
in
l
for
l
in
stdout
.
splitlines
()),
'Fail to step into the caller after a return'
)
def
test_issue16180
(
self
):
# A syntax error in the debuggee.
script
=
"def f: pass
\n
"
commands
=
''
expected
=
"SyntaxError:"
stdout
,
stderr
=
self
.
run_pdb
(
script
,
commands
)
self
.
assertIn
(
expected
,
stdout
,
'
\n\n
Expected:
\n
{}
\n
Got:
\n
{}
\n
'
'Fail to handle a syntax error in the debuggee.'
.
format
(
expected
,
stdout
))
class
PdbTestInput
(
object
):
"""Context manager that makes testing Pdb in doctests easier."""
...
...
Misc/NEWS
Dosyayı görüntüle @
23ae488f
...
...
@@ -37,6 +37,9 @@ Core and Builtins
Library
-------
-
Issue
#
16180
:
Exit
pdb
if
file
has
syntax
error
,
instead
of
trapping
user
in
an
infinite
loop
.
Patch
by
Xavier
de
Gaye
.
-
Issue
#
22812
:
Fix
unittest
discovery
examples
.
Patch
from
Pam
McA
'Nulty.
...
...
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