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
f3b06394
Kaydet (Commit)
f3b06394
authored
Eyl 22, 2016
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #27348: Merge exception formatting fix from 3.5 into 3.6
üst
e3d50409
bb8b1cb6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
7 deletions
+18
-7
_pydecimal.py
Lib/_pydecimal.py
+1
-1
test_traceback.py
Lib/test/test_traceback.py
+12
-5
traceback.py
Lib/traceback.py
+1
-1
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/_pydecimal.py
Dosyayı görüntüle @
f3b06394
...
...
@@ -4156,7 +4156,7 @@ class Context(object):
>>> context.create_decimal_from_float(3.1415926535897932)
Traceback (most recent call last):
...
decimal.Inexact
decimal.Inexact
: None
"""
d
=
Decimal
.
from_float
(
f
)
# An exact conversion
...
...
Lib/test/test_traceback.py
Dosyayı görüntüle @
f3b06394
...
...
@@ -19,7 +19,7 @@ test_frame = namedtuple('frame', ['f_code', 'f_globals', 'f_locals'])
test_tb
=
namedtuple
(
'tb'
,
[
'tb_frame'
,
'tb_lineno'
,
'tb_next'
])
class
Syntax
TracebackCases
(
unittest
.
TestCase
):
class
TracebackCases
(
unittest
.
TestCase
):
# For now, a very minimal set of tests. I want to be sure that
# formatting of SyntaxErrors works based on changes for 2.1.
...
...
@@ -106,10 +106,6 @@ class SyntaxTracebackCases(unittest.TestCase):
str_name
=
'.'
.
join
([
X
.
__module__
,
X
.
__qualname__
])
self
.
assertEqual
(
err
[
0
],
"
%
s:
%
s
\n
"
%
(
str_name
,
str_value
))
def
test_without_exception
(
self
):
err
=
traceback
.
format_exception_only
(
None
,
None
)
self
.
assertEqual
(
err
,
[
'None
\n
'
])
def
test_encoded_file
(
self
):
# Test that tracebacks are correctly printed for encoded source files:
# - correct line number (Issue2384)
...
...
@@ -587,6 +583,17 @@ class BaseExceptionReportingTests:
msg
=
self
.
get_report
(
e
)
.
splitlines
()
self
.
assertEqual
(
msg
[
-
2
],
' ^'
)
def
test_message_none
(
self
):
# A message that looks like "None" should not be treated specially
err
=
self
.
get_report
(
Exception
(
None
))
self
.
assertIn
(
'Exception: None
\n
'
,
err
)
err
=
self
.
get_report
(
Exception
(
'None'
))
self
.
assertIn
(
'Exception: None
\n
'
,
err
)
err
=
self
.
get_report
(
Exception
())
self
.
assertIn
(
'Exception
\n
'
,
err
)
err
=
self
.
get_report
(
Exception
(
''
))
self
.
assertIn
(
'Exception
\n
'
,
err
)
class
PyExcReportingTests
(
BaseExceptionReportingTests
,
unittest
.
TestCase
):
#
...
...
Lib/traceback.py
Dosyayı görüntüle @
f3b06394
...
...
@@ -140,7 +140,7 @@ def format_exception_only(etype, value):
def
_format_final_exc_line
(
etype
,
value
):
valuestr
=
_some_str
(
value
)
if
value
==
'None'
or
value
is
None
or
not
valuestr
:
if
value
is
None
or
not
valuestr
:
line
=
"
%
s
\n
"
%
etype
else
:
line
=
"
%
s:
%
s
\n
"
%
(
etype
,
valuestr
)
...
...
Misc/NEWS
Dosyayı görüntüle @
f3b06394
...
...
@@ -35,6 +35,10 @@ Core and Builtins
Library
-------
- Issue #27348: In the traceback module, restore the formatting of exception
messages like "Exception: None". This fixes a regression introduced in
3.5a2.
- Issue #25651: Allow falsy values to be used for msg parameter of subTest().
- Issue #27778: Fix a memory leak in os.getrandom() when the getrandom() is
...
...
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