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
6d35043e
Kaydet (Commit)
6d35043e
authored
Tem 23, 2015
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge 3.5 (Issue #24687)
üst
9b7a2445
f315c1c0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
15 deletions
+22
-15
test_coroutines.py
Lib/test/test_coroutines.py
+4
-0
test_grammar.py
Lib/test/test_grammar.py
+2
-1
NEWS
Misc/NEWS
+3
-0
compile.c
Python/compile.c
+13
-14
No files found.
Lib/test/test_coroutines.py
Dosyayı görüntüle @
6d35043e
...
...
@@ -211,6 +211,10 @@ class AsyncBadSyntaxTest(unittest.TestCase):
pass
"""
,
"""async def foo(a:await b):
pass
"""
,
"""def baz():
async def foo(a=await b):
pass
...
...
Lib/test/test_grammar.py
Dosyayı görüntüle @
6d35043e
...
...
@@ -534,7 +534,8 @@ class GrammarTests(unittest.TestCase):
# Not allowed at class scope
check_syntax_error
(
self
,
"class foo:yield 1"
)
check_syntax_error
(
self
,
"class foo:yield from ()"
)
# Check annotation refleak on SyntaxError
check_syntax_error
(
self
,
"def g(a:(yield)): pass"
)
def
test_raise
(
self
):
# 'raise' test [',' test]
...
...
Misc/NEWS
Dosyayı görüntüle @
6d35043e
...
...
@@ -48,6 +48,9 @@ Core and Builtins
- Issue #24619: New approach for tokenizing async/await. As a consequence,
is is now possible to have one-line '
async
def
foo
():
await
..
' functions.
- Issue #24687: Plug refleak on SyntaxError in function parameters
annotations.
Library
-------
...
...
Python/compile.c
Dosyayı görüntüle @
6d35043e
...
...
@@ -1559,32 +1559,31 @@ compiler_visit_argannotation(struct compiler *c, identifier id,
VISIT
(
c
,
expr
,
annotation
);
mangled
=
_Py_Mangle
(
c
->
u
->
u_private
,
id
);
if
(
!
mangled
)
return
-
1
;
return
0
;
if
(
PyList_Append
(
names
,
mangled
)
<
0
)
{
Py_DECREF
(
mangled
);
return
-
1
;
return
0
;
}
Py_DECREF
(
mangled
);
}
return
0
;
return
1
;
}
static
int
compiler_visit_argannotations
(
struct
compiler
*
c
,
asdl_seq
*
args
,
PyObject
*
names
)
{
int
i
,
error
;
int
i
;
for
(
i
=
0
;
i
<
asdl_seq_LEN
(
args
);
i
++
)
{
arg_ty
arg
=
(
arg_ty
)
asdl_seq_GET
(
args
,
i
);
error
=
compiler_visit_argannotation
(
if
(
!
compiler_visit_argannotation
(
c
,
arg
->
arg
,
arg
->
annotation
,
names
);
if
(
error
)
return
error
;
names
))
return
0
;
}
return
0
;
return
1
;
}
static
int
...
...
@@ -1604,16 +1603,16 @@ compiler_visit_annotations(struct compiler *c, arguments_ty args,
if
(
!
names
)
return
-
1
;
if
(
compiler_visit_argannotations
(
c
,
args
->
args
,
names
))
if
(
!
compiler_visit_argannotations
(
c
,
args
->
args
,
names
))
goto
error
;
if
(
args
->
vararg
&&
args
->
vararg
->
annotation
&&
compiler_visit_argannotation
(
c
,
args
->
vararg
->
arg
,
!
compiler_visit_argannotation
(
c
,
args
->
vararg
->
arg
,
args
->
vararg
->
annotation
,
names
))
goto
error
;
if
(
compiler_visit_argannotations
(
c
,
args
->
kwonlyargs
,
names
))
if
(
!
compiler_visit_argannotations
(
c
,
args
->
kwonlyargs
,
names
))
goto
error
;
if
(
args
->
kwarg
&&
args
->
kwarg
->
annotation
&&
compiler_visit_argannotation
(
c
,
args
->
kwarg
->
arg
,
!
compiler_visit_argannotation
(
c
,
args
->
kwarg
->
arg
,
args
->
kwarg
->
annotation
,
names
))
goto
error
;
...
...
@@ -1622,7 +1621,7 @@ compiler_visit_annotations(struct compiler *c, arguments_ty args,
if
(
!
return_str
)
goto
error
;
}
if
(
compiler_visit_argannotation
(
c
,
return_str
,
returns
,
names
))
{
if
(
!
compiler_visit_argannotation
(
c
,
return_str
,
returns
,
names
))
{
goto
error
;
}
...
...
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