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
2fe3ef87
Kaydet (Commit)
2fe3ef87
authored
Haz 08, 2008
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
change Py3k backquote warning to a SyntaxWarning and add a test
üst
1f1174ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
test_py3kwarn.py
Lib/test/test_py3kwarn.py
+6
-0
ast.c
Python/ast.c
+1
-1
No files found.
Lib/test/test_py3kwarn.py
Dosyayı görüntüle @
2fe3ef87
...
@@ -10,6 +10,12 @@ if not sys.py3kwarning:
...
@@ -10,6 +10,12 @@ if not sys.py3kwarning:
class
TestPy3KWarnings
(
unittest
.
TestCase
):
class
TestPy3KWarnings
(
unittest
.
TestCase
):
def
test_backquote
(
self
):
expected
=
'backquote not supported in 3.x; use repr()'
with
catch_warning
()
as
w
:
exec
"`2`"
in
{}
self
.
assertWarning
(
None
,
w
,
expected
)
def
test_type_inequality_comparisons
(
self
):
def
test_type_inequality_comparisons
(
self
):
expected
=
'type inequality comparisons not supported in 3.x'
expected
=
'type inequality comparisons not supported in 3.x'
with
catch_warning
()
as
w
:
with
catch_warning
()
as
w
:
...
...
Python/ast.c
Dosyayı görüntüle @
2fe3ef87
...
@@ -1364,7 +1364,7 @@ ast_for_atom(struct compiling *c, const node *n)
...
@@ -1364,7 +1364,7 @@ ast_for_atom(struct compiling *c, const node *n)
case
BACKQUOTE
:
{
/* repr */
case
BACKQUOTE
:
{
/* repr */
expr_ty
expression
;
expr_ty
expression
;
if
(
Py_Py3kWarningFlag
)
{
if
(
Py_Py3kWarningFlag
)
{
if
(
PyErr_WarnExplicit
(
PyExc_
Deprecation
Warning
,
if
(
PyErr_WarnExplicit
(
PyExc_
Syntax
Warning
,
"backquote not supported in 3.x; use repr()"
,
"backquote not supported in 3.x; use repr()"
,
c
->
c_filename
,
LINENO
(
n
),
c
->
c_filename
,
LINENO
(
n
),
NULL
,
NULL
))
{
NULL
,
NULL
))
{
...
...
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