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
bca4939d
Kaydet (Commit)
bca4939d
authored
Eyl 03, 2017
tarafından
Serhiy Storchaka
Kaydeden (comit)
GitHub
Eyl 03, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-31185: Fixed miscellaneous errors in asyncio speedup module. (#3076)
üst
8df44ee8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
12 deletions
+42
-12
test_futures.py
Lib/test/test_asyncio/test_futures.py
+37
-8
2017-08-11-19-30-00.bpo-31185.i6TPgL.rst
...S.d/next/Library/2017-08-11-19-30-00.bpo-31185.i6TPgL.rst
+1
-0
_asynciomodule.c
Modules/_asynciomodule.c
+0
-0
_asynciomodule.c.h
Modules/clinic/_asynciomodule.c.h
+4
-4
No files found.
Lib/test/test_asyncio/test_futures.py
Dosyayı görüntüle @
bca4939d
...
...
@@ -100,8 +100,8 @@ class DuckTests(test_utils.TestCase):
class
BaseFutureTests
:
def
_new_future
(
self
,
loop
=
None
):
r
aise
NotImplementedError
def
_new_future
(
self
,
*
args
,
**
kwargs
):
r
eturn
self
.
cls
(
*
args
,
**
kwargs
)
def
setUp
(
self
):
super
()
.
setUp
()
...
...
@@ -147,6 +147,39 @@ class BaseFutureTests:
# Make sure Future doesn't accept a positional argument
self
.
assertRaises
(
TypeError
,
self
.
_new_future
,
42
)
def
test_uninitialized
(
self
):
fut
=
self
.
cls
.
__new__
(
self
.
cls
,
loop
=
self
.
loop
)
self
.
assertRaises
(
asyncio
.
InvalidStateError
,
fut
.
result
)
fut
=
self
.
cls
.
__new__
(
self
.
cls
,
loop
=
self
.
loop
)
self
.
assertRaises
(
asyncio
.
InvalidStateError
,
fut
.
exception
)
fut
=
self
.
cls
.
__new__
(
self
.
cls
,
loop
=
self
.
loop
)
with
self
.
assertRaises
((
RuntimeError
,
AttributeError
)):
fut
.
set_result
(
None
)
fut
=
self
.
cls
.
__new__
(
self
.
cls
,
loop
=
self
.
loop
)
with
self
.
assertRaises
((
RuntimeError
,
AttributeError
)):
fut
.
set_exception
(
Exception
)
fut
=
self
.
cls
.
__new__
(
self
.
cls
,
loop
=
self
.
loop
)
with
self
.
assertRaises
((
RuntimeError
,
AttributeError
)):
fut
.
cancel
()
fut
=
self
.
cls
.
__new__
(
self
.
cls
,
loop
=
self
.
loop
)
with
self
.
assertRaises
((
RuntimeError
,
AttributeError
)):
fut
.
add_done_callback
(
lambda
f
:
None
)
fut
=
self
.
cls
.
__new__
(
self
.
cls
,
loop
=
self
.
loop
)
with
self
.
assertRaises
((
RuntimeError
,
AttributeError
)):
fut
.
remove_done_callback
(
lambda
f
:
None
)
fut
=
self
.
cls
.
__new__
(
self
.
cls
,
loop
=
self
.
loop
)
with
self
.
assertRaises
((
RuntimeError
,
AttributeError
)):
fut
.
_schedule_callbacks
()
fut
=
self
.
cls
.
__new__
(
self
.
cls
,
loop
=
self
.
loop
)
try
:
repr
(
fut
)
except
AttributeError
:
pass
fut
=
self
.
cls
.
__new__
(
self
.
cls
,
loop
=
self
.
loop
)
fut
.
cancelled
()
fut
.
done
()
iter
(
fut
)
def
test_cancel
(
self
):
f
=
self
.
_new_future
(
loop
=
self
.
loop
)
self
.
assertTrue
(
f
.
cancel
())
...
...
@@ -501,15 +534,11 @@ class BaseFutureTests:
@unittest.skipUnless
(
hasattr
(
futures
,
'_CFuture'
),
'requires the C _asyncio module'
)
class
CFutureTests
(
BaseFutureTests
,
test_utils
.
TestCase
):
def
_new_future
(
self
,
*
args
,
**
kwargs
):
return
futures
.
_CFuture
(
*
args
,
**
kwargs
)
cls
=
getattr
(
futures
,
'_CFuture'
)
class
PyFutureTests
(
BaseFutureTests
,
test_utils
.
TestCase
):
def
_new_future
(
self
,
*
args
,
**
kwargs
):
return
futures
.
_PyFuture
(
*
args
,
**
kwargs
)
cls
=
futures
.
_PyFuture
class
BaseFutureDoneCallbackTests
():
...
...
Misc/NEWS.d/next/Library/2017-08-11-19-30-00.bpo-31185.i6TPgL.rst
0 → 100644
Dosyayı görüntüle @
bca4939d
Fixed miscellaneous errors in asyncio speedup module.
Modules/_asynciomodule.c
Dosyayı görüntüle @
bca4939d
This diff is collapsed.
Click to expand it.
Modules/clinic/_asynciomodule.c.h
Dosyayı görüntüle @
bca4939d
...
...
@@ -28,7 +28,7 @@ _asyncio_Future___init__(PyObject *self, PyObject *args, PyObject *kwargs)
int
return_value
=
-
1
;
static
const
char
*
const
_keywords
[]
=
{
"loop"
,
NULL
};
static
_PyArg_Parser
_parser
=
{
"|$O:Future"
,
_keywords
,
0
};
PyObject
*
loop
=
NULL
;
PyObject
*
loop
=
Py_None
;
if
(
!
_PyArg_ParseTupleAndKeywordsFast
(
args
,
kwargs
,
&
_parser
,
&
loop
))
{
...
...
@@ -244,7 +244,7 @@ _asyncio_Task___init__(PyObject *self, PyObject *args, PyObject *kwargs)
static
const
char
*
const
_keywords
[]
=
{
"coro"
,
"loop"
,
NULL
};
static
_PyArg_Parser
_parser
=
{
"O|$O:Task"
,
_keywords
,
0
};
PyObject
*
coro
;
PyObject
*
loop
=
NULL
;
PyObject
*
loop
=
Py_None
;
if
(
!
_PyArg_ParseTupleAndKeywordsFast
(
args
,
kwargs
,
&
_parser
,
&
coro
,
&
loop
))
{
...
...
@@ -477,7 +477,7 @@ _asyncio_Task__step(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject *
PyObject
*
return_value
=
NULL
;
static
const
char
*
const
_keywords
[]
=
{
"exc"
,
NULL
};
static
_PyArg_Parser
_parser
=
{
"|O:_step"
,
_keywords
,
0
};
PyObject
*
exc
=
NULL
;
PyObject
*
exc
=
Py_None
;
if
(
!
_PyArg_ParseStackAndKeywords
(
args
,
nargs
,
kwnames
,
&
_parser
,
&
exc
))
{
...
...
@@ -517,4 +517,4 @@ _asyncio_Task__wakeup(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject
exit:
return
return_value
;
}
/*[clinic end generated code: output=
fe651840e0466fa9
input=a9049054013a1b77]*/
/*[clinic end generated code: output=
b92f9cd2b9fb37ef
input=a9049054013a1b77]*/
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