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
d6030acd
Kaydet (Commit)
d6030acd
authored
Nis 02, 2007
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Array module's buffer interface can now handle empty arrays.
üst
4bbcb64d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
test_re.py
Lib/test/test_re.py
+7
-0
NEWS
Misc/NEWS
+2
-0
arraymodule.c
Modules/arraymodule.c
+6
-0
No files found.
Lib/test/test_re.py
Dosyayı görüntüle @
d6030acd
...
@@ -604,6 +604,13 @@ class ReTests(unittest.TestCase):
...
@@ -604,6 +604,13 @@ class ReTests(unittest.TestCase):
self
.
assertEqual
(
iter
.
next
()
.
span
(),
(
4
,
4
))
self
.
assertEqual
(
iter
.
next
()
.
span
(),
(
4
,
4
))
self
.
assertRaises
(
StopIteration
,
iter
.
next
)
self
.
assertRaises
(
StopIteration
,
iter
.
next
)
def
test_empty_array
(
self
):
# SF buf 1647541
import
array
for
typecode
in
'cbBuhHiIlLfd'
:
a
=
array
.
array
(
typecode
)
self
.
assertEqual
(
re
.
compile
(
"bla"
)
.
match
(
a
),
None
)
self
.
assertEqual
(
re
.
compile
(
""
)
.
match
(
a
)
.
groups
(),
())
def
run_re_tests
():
def
run_re_tests
():
from
test.re_tests
import
benchmarks
,
tests
,
SUCCEED
,
FAIL
,
SYNTAX_ERROR
from
test.re_tests
import
benchmarks
,
tests
,
SUCCEED
,
FAIL
,
SYNTAX_ERROR
...
...
Misc/NEWS
Dosyayı görüntüle @
d6030acd
...
@@ -134,6 +134,8 @@ Core and builtins
...
@@ -134,6 +134,8 @@ Core and builtins
Extension
Modules
Extension
Modules
-----------------
-----------------
-
Bug
#
1647541
:
Array
module
's buffer interface can now handle empty arrays.
- Bug #1693079: The array module can now successfully pickle empty arrays.
- Bug #1693079: The array module can now successfully pickle empty arrays.
- Bug #1688393: Prevent crash in socket.recvfrom if length is negative.
- Bug #1688393: Prevent crash in socket.recvfrom if length is negative.
...
...
Modules/arraymodule.c
Dosyayı görüntüle @
d6030acd
...
@@ -1745,6 +1745,8 @@ static PyMappingMethods array_as_mapping = {
...
@@ -1745,6 +1745,8 @@ static PyMappingMethods array_as_mapping = {
(
objobjargproc
)
array_ass_subscr
(
objobjargproc
)
array_ass_subscr
};
};
static
const
void
*
emptybuf
=
""
;
static
Py_ssize_t
static
Py_ssize_t
array_buffer_getreadbuf
(
arrayobject
*
self
,
Py_ssize_t
index
,
const
void
**
ptr
)
array_buffer_getreadbuf
(
arrayobject
*
self
,
Py_ssize_t
index
,
const
void
**
ptr
)
{
{
...
@@ -1754,6 +1756,8 @@ array_buffer_getreadbuf(arrayobject *self, Py_ssize_t index, const void **ptr)
...
@@ -1754,6 +1756,8 @@ array_buffer_getreadbuf(arrayobject *self, Py_ssize_t index, const void **ptr)
return
-
1
;
return
-
1
;
}
}
*
ptr
=
(
void
*
)
self
->
ob_item
;
*
ptr
=
(
void
*
)
self
->
ob_item
;
if
(
*
ptr
==
NULL
)
*
ptr
=
emptybuf
;
return
self
->
ob_size
*
self
->
ob_descr
->
itemsize
;
return
self
->
ob_size
*
self
->
ob_descr
->
itemsize
;
}
}
...
@@ -1766,6 +1770,8 @@ array_buffer_getwritebuf(arrayobject *self, Py_ssize_t index, const void **ptr)
...
@@ -1766,6 +1770,8 @@ array_buffer_getwritebuf(arrayobject *self, Py_ssize_t index, const void **ptr)
return
-
1
;
return
-
1
;
}
}
*
ptr
=
(
void
*
)
self
->
ob_item
;
*
ptr
=
(
void
*
)
self
->
ob_item
;
if
(
*
ptr
==
NULL
)
*
ptr
=
emptybuf
;
return
self
->
ob_size
*
self
->
ob_descr
->
itemsize
;
return
self
->
ob_size
*
self
->
ob_descr
->
itemsize
;
}
}
...
...
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