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
b7666a30
Kaydet (Commit)
b7666a30
authored
Tem 22, 2015
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #24619: More tests; fix nits in compiler.c
üst
8fb307cd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
badsyntax_async2.py
Lib/test/badsyntax_async2.py
+1
-1
test_coroutines.py
Lib/test/test_coroutines.py
+5
-4
compile.c
Python/compile.c
+2
-3
symtable.c
Python/symtable.c
+1
-1
No files found.
Lib/test/badsyntax_async2.py
Dosyayı görüntüle @
b7666a30
async
def
foo
(
a
:
await
something
()):
async
def
foo
(
a
=
await
something
()):
pass
pass
Lib/test/test_coroutines.py
Dosyayı görüntüle @
b7666a30
...
@@ -205,12 +205,14 @@ class AsyncBadSyntaxTest(unittest.TestCase):
...
@@ -205,12 +205,14 @@ class AsyncBadSyntaxTest(unittest.TestCase):
return lambda a: await
return lambda a: await
"""
,
"""
,
"""async def foo(a: await b):
"""await a()"""
,
"""async def foo(a=await b):
pass
pass
"""
,
"""
,
"""def baz():
"""def baz():
async def foo(a
:
await b):
async def foo(a
=
await b):
pass
pass
"""
,
"""
,
...
@@ -271,10 +273,9 @@ class AsyncBadSyntaxTest(unittest.TestCase):
...
@@ -271,10 +273,9 @@ class AsyncBadSyntaxTest(unittest.TestCase):
pass
\n
await a
pass
\n
await a
"""
]
"""
]
ns
=
{}
for
code
in
samples
:
for
code
in
samples
:
with
self
.
subTest
(
code
=
code
),
self
.
assertRaises
(
SyntaxError
):
with
self
.
subTest
(
code
=
code
),
self
.
assertRaises
(
SyntaxError
):
exec
(
code
,
ns
,
ns
)
compile
(
code
,
"<test>"
,
"exec"
)
def
test_goodsyntax_1
(
self
):
def
test_goodsyntax_1
(
self
):
# Tests for issue 24619
# Tests for issue 24619
...
...
Python/compile.c
Dosyayı görüntüle @
b7666a30
...
@@ -1749,13 +1749,12 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async)
...
@@ -1749,13 +1749,12 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async)
arglength
=
asdl_seq_LEN
(
args
->
defaults
);
arglength
=
asdl_seq_LEN
(
args
->
defaults
);
arglength
|=
kw_default_count
<<
8
;
arglength
|=
kw_default_count
<<
8
;
arglength
|=
num_annotations
<<
16
;
arglength
|=
num_annotations
<<
16
;
if
(
is_async
)
co
->
co_flags
|=
CO_COROUTINE
;
compiler_make_closure
(
c
,
co
,
arglength
,
qualname
);
compiler_make_closure
(
c
,
co
,
arglength
,
qualname
);
Py_DECREF
(
qualname
);
Py_DECREF
(
qualname
);
Py_DECREF
(
co
);
Py_DECREF
(
co
);
if
(
is_async
)
co
->
co_flags
|=
CO_COROUTINE
;
/* decorators */
/* decorators */
for
(
i
=
0
;
i
<
asdl_seq_LEN
(
decos
);
i
++
)
{
for
(
i
=
0
;
i
<
asdl_seq_LEN
(
decos
);
i
++
)
{
ADDOP_I
(
c
,
CALL_FUNCTION
,
1
);
ADDOP_I
(
c
,
CALL_FUNCTION
,
1
);
...
...
Python/symtable.c
Dosyayı görüntüle @
b7666a30
...
@@ -1542,7 +1542,7 @@ symtable_visit_annotations(struct symtable *st, stmt_ty s,
...
@@ -1542,7 +1542,7 @@ symtable_visit_annotations(struct symtable *st, stmt_ty s,
if
(
a
->
kwonlyargs
&&
!
symtable_visit_argannotations
(
st
,
a
->
kwonlyargs
))
if
(
a
->
kwonlyargs
&&
!
symtable_visit_argannotations
(
st
,
a
->
kwonlyargs
))
return
0
;
return
0
;
if
(
returns
)
if
(
returns
)
VISIT
(
st
,
expr
,
s
->
v
.
FunctionDef
.
returns
);
VISIT
(
st
,
expr
,
returns
);
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