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
08133af1
Kaydet (Commit)
08133af1
authored
Eki 15, 2009
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #7142: Fix uses of unicode in memoryview objects
üst
196b0925
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
test_memoryview.py
Lib/test/test_memoryview.py
+7
-0
memoryobject.c
Objects/memoryobject.c
+2
-2
No files found.
Lib/test/test_memoryview.py
Dosyayı görüntüle @
08133af1
...
...
@@ -54,6 +54,12 @@ class AbstractMemoryTests:
m
=
self
.
_view
(
b
)
self
.
assertEqual
(
list
(
m
),
[
m
[
i
]
for
i
in
range
(
len
(
m
))])
def
test_repr
(
self
):
for
tp
in
self
.
_types
:
b
=
tp
(
self
.
_source
)
m
=
self
.
_view
(
b
)
self
.
assertIsInstance
(
m
.
__repr__
(),
str
)
def
test_setitem_readonly
(
self
):
if
not
self
.
ro_type
:
return
...
...
@@ -156,6 +162,7 @@ class AbstractMemoryTests:
def
check_attributes_with_type
(
self
,
tp
):
m
=
self
.
_view
(
tp
(
self
.
_source
))
self
.
assertEquals
(
m
.
format
,
self
.
format
)
self
.
assertIsInstance
(
m
.
format
,
str
)
self
.
assertEquals
(
m
.
itemsize
,
self
.
itemsize
)
self
.
assertEquals
(
m
.
ndim
,
1
)
self
.
assertEquals
(
m
.
shape
,
(
6
,))
...
...
Objects/memoryobject.c
Dosyayı görüntüle @
08133af1
...
...
@@ -335,7 +335,7 @@ PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort)
static
PyObject
*
memory_format_get
(
PyMemoryViewObject
*
self
)
{
return
Py
Unicode
_FromString
(
self
->
view
.
format
);
return
Py
String
_FromString
(
self
->
view
.
format
);
}
static
PyObject
*
...
...
@@ -503,7 +503,7 @@ memory_dealloc(PyMemoryViewObject *self)
static
PyObject
*
memory_repr
(
PyMemoryViewObject
*
self
)
{
return
Py
Unicode
_FromFormat
(
"<memory at %p>"
,
self
);
return
Py
String
_FromFormat
(
"<memory at %p>"
,
self
);
}
/* Sequence methods */
...
...
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