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
41f9d04e
Kaydet (Commit)
41f9d04e
authored
Haz 30, 2012
tarafından
doko@ubuntu.com
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
null merge
üst
49a7da30
f87289bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
test_pep3151.py
Lib/test/test_pep3151.py
+10
-0
NEWS
Misc/NEWS
+3
-0
exceptions.c
Objects/exceptions.c
+6
-0
No files found.
Lib/test/test_pep3151.py
Dosyayı görüntüle @
41f9d04e
...
@@ -29,6 +29,10 @@ class SubOSErrorCombinedInitFirst(SubOSErrorWithInit, SubOSErrorWithNew):
...
@@ -29,6 +29,10 @@ class SubOSErrorCombinedInitFirst(SubOSErrorWithInit, SubOSErrorWithNew):
class
SubOSErrorCombinedNewFirst
(
SubOSErrorWithNew
,
SubOSErrorWithInit
):
class
SubOSErrorCombinedNewFirst
(
SubOSErrorWithNew
,
SubOSErrorWithInit
):
pass
pass
class
SubOSErrorWithStandaloneInit
(
OSError
):
def
__init__
(
self
):
pass
class
HierarchyTest
(
unittest
.
TestCase
):
class
HierarchyTest
(
unittest
.
TestCase
):
...
@@ -193,6 +197,12 @@ class ExplicitSubclassingTest(unittest.TestCase):
...
@@ -193,6 +197,12 @@ class ExplicitSubclassingTest(unittest.TestCase):
self
.
assertEqual
(
e
.
baz
,
"baz"
)
self
.
assertEqual
(
e
.
baz
,
"baz"
)
self
.
assertEqual
(
e
.
args
,
(
"some message"
,))
self
.
assertEqual
(
e
.
args
,
(
"some message"
,))
def
test_init_standalone
(
self
):
# __init__ doesn't propagate to OSError.__init__ (see issue #15229)
e
=
SubOSErrorWithStandaloneInit
()
self
.
assertEqual
(
e
.
args
,
())
self
.
assertEqual
(
str
(
e
),
''
)
def
test_main
():
def
test_main
():
support
.
run_unittest
(
__name__
)
support
.
run_unittest
(
__name__
)
...
...
Misc/NEWS
Dosyayı görüntüle @
41f9d04e
...
@@ -10,6 +10,9 @@ What's New in Python 3.3.0 Beta 2?
...
@@ -10,6 +10,9 @@ What's New in Python 3.3.0 Beta 2?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #15229: An OSError subclass whose __init__ doesn'
t
call
back
OSError
.
__init__
could
produce
incomplete
instances
,
leading
to
crashes
when
calling
str
()
on
them
.
Library
Library
-------
-------
...
...
Objects/exceptions.c
Dosyayı görüntüle @
41f9d04e
...
@@ -834,6 +834,7 @@ oserror_init(PyOSErrorObject *self, PyObject **p_args,
...
@@ -834,6 +834,7 @@ oserror_init(PyOSErrorObject *self, PyObject **p_args,
#endif
#endif
/* Steals the reference to args */
/* Steals the reference to args */
Py_CLEAR
(
self
->
args
);
self
->
args
=
args
;
self
->
args
=
args
;
args
=
NULL
;
args
=
NULL
;
...
@@ -916,6 +917,11 @@ OSError_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -916,6 +917,11 @@ OSError_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
))
))
goto
error
;
goto
error
;
}
}
else
{
self
->
args
=
PyTuple_New
(
0
);
if
(
self
->
args
==
NULL
)
goto
error
;
}
return
(
PyObject
*
)
self
;
return
(
PyObject
*
)
self
;
...
...
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