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
e0793ba9
Kaydet (Commit)
e0793ba9
authored
Eyl 01, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #9737: Fix a crash when trying to delete a slice or an item from
a memoryview object.
üst
6cb5ad03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
test_memoryview.py
Lib/test/test_memoryview.py
+9
-0
NEWS
Misc/NEWS
+3
-0
memoryobject.c
Objects/memoryobject.c
+5
-0
No files found.
Lib/test/test_memoryview.py
Dosyayı görüntüle @
e0793ba9
...
@@ -111,6 +111,15 @@ class AbstractMemoryTests:
...
@@ -111,6 +111,15 @@ class AbstractMemoryTests:
m
=
None
m
=
None
self
.
assertEquals
(
sys
.
getrefcount
(
b
),
oldrefcount
)
self
.
assertEquals
(
sys
.
getrefcount
(
b
),
oldrefcount
)
def
test_delitem
(
self
):
for
tp
in
self
.
_types
:
b
=
tp
(
self
.
_source
)
m
=
self
.
_view
(
b
)
with
self
.
assertRaises
(
TypeError
):
del
m
[
1
]
with
self
.
assertRaises
(
TypeError
):
del
m
[
1
:
4
]
def
test_tobytes
(
self
):
def
test_tobytes
(
self
):
for
tp
in
self
.
_types
:
for
tp
in
self
.
_types
:
m
=
self
.
_view
(
tp
(
self
.
_source
))
m
=
self
.
_view
(
tp
(
self
.
_source
))
...
...
Misc/NEWS
Dosyayı görüntüle @
e0793ba9
...
@@ -12,6 +12,9 @@ What's New in Python 3.2 Alpha 2?
...
@@ -12,6 +12,9 @@ What's New in Python 3.2 Alpha 2?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #9737: Fix a crash when trying to delete a slice or an item from
a memoryview object.
- Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding()
- Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding()
are now removed, since their effect was inexistent in 3.x (the default
are now removed, since their effect was inexistent in 3.x (the default
encoding is hardcoded to utf-8 and cannot be changed).
encoding is hardcoded to utf-8 and cannot be changed).
...
...
Objects/memoryobject.c
Dosyayı görüntüle @
e0793ba9
...
@@ -631,6 +631,11 @@ memory_ass_sub(PyMemoryViewObject *self, PyObject *key, PyObject *value)
...
@@ -631,6 +631,11 @@ memory_ass_sub(PyMemoryViewObject *self, PyObject *key, PyObject *value)
"cannot modify read-only memory"
);
"cannot modify read-only memory"
);
return
-
1
;
return
-
1
;
}
}
if
(
value
==
NULL
)
{
PyErr_SetString
(
PyExc_TypeError
,
"cannot delete memory"
);
return
-
1
;
}
if
(
view
->
ndim
!=
1
)
{
if
(
view
->
ndim
!=
1
)
{
PyErr_SetNone
(
PyExc_NotImplementedError
);
PyErr_SetNone
(
PyExc_NotImplementedError
);
return
-
1
;
return
-
1
;
...
...
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