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
07c6e716
Kaydet (Commit)
07c6e716
authored
Agu 24, 2012
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #15778: Coerce ImportError.args to a string when it isn't
already one. Patch by Dave Malcolm.
üst
491b1dc7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
test_exceptions.py
Lib/test/test_exceptions.py
+5
-0
NEWS
Misc/NEWS
+3
-0
exceptions.c
Objects/exceptions.c
+1
-1
No files found.
Lib/test/test_exceptions.py
Dosyayı görüntüle @
07c6e716
...
...
@@ -937,6 +937,11 @@ class ImportErrorTests(unittest.TestCase):
self
.
assertEqual
(
exc
.
name
,
'somename'
)
self
.
assertEqual
(
exc
.
path
,
'somepath'
)
def
test_non_str_argument
(
self
):
# Issue #15778
arg
=
b
'abc'
exc
=
ImportError
(
arg
)
self
.
assertEqual
(
str
(
arg
),
str
(
exc
))
def
test_main
():
...
...
Misc/NEWS
Dosyayı görüntüle @
07c6e716
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.3.0 Release Candidate 1?
Core and Builtins
-----------------
- Issue #15778: ensure that str(ImportError(msg)) returns a str
even when msg isn'
t
a
str
.
-
Issue
#
2051
:
Source
file
permission
bits
are
once
again
correctly
copied
to
the
cached
bytecode
file
.
(
The
migration
to
importlib
reintroduced
this
problem
because
these
was
no
regression
test
.
A
test
...
...
Objects/exceptions.c
Dosyayı görüntüle @
07c6e716
...
...
@@ -679,7 +679,7 @@ ImportError_traverse(PyImportErrorObject *self, visitproc visit, void *arg)
static
PyObject
*
ImportError_str
(
PyImportErrorObject
*
self
)
{
if
(
self
->
msg
)
{
if
(
self
->
msg
&&
PyUnicode_CheckExact
(
self
->
msg
)
)
{
Py_INCREF
(
self
->
msg
);
return
self
->
msg
;
}
...
...
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