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
1a5e5de8
Kaydet (Commit)
1a5e5de8
authored
Mar 14, 2012
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
remove get_prefix and set_prefix (#13248)
üst
7c466b4f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
37 deletions
+2
-37
pytree.py
Lib/lib2to3/pytree.py
+0
-20
test_pytree.py
Lib/lib2to3/tests/test_pytree.py
+0
-17
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/lib2to3/pytree.py
Dosyayı görüntüle @
1a5e5de8
...
@@ -109,26 +109,6 @@ class Base(object):
...
@@ -109,26 +109,6 @@ class Base(object):
"""
"""
raise
NotImplementedError
raise
NotImplementedError
def
set_prefix
(
self
,
prefix
):
"""
Set the prefix for the node (see Leaf class).
DEPRECATED; use the prefix property directly.
"""
warnings
.
warn
(
"set_prefix() is deprecated; use the prefix property"
,
DeprecationWarning
,
stacklevel
=
2
)
self
.
prefix
=
prefix
def
get_prefix
(
self
):
"""
Return the prefix for the node (see Leaf class).
DEPRECATED; use the prefix property directly.
"""
warnings
.
warn
(
"get_prefix() is deprecated; use the prefix property"
,
DeprecationWarning
,
stacklevel
=
2
)
return
self
.
prefix
def
replace
(
self
,
new
):
def
replace
(
self
,
new
):
"""Replace this node with a new one in the parent."""
"""Replace this node with a new one in the parent."""
assert
self
.
parent
is
not
None
,
str
(
self
)
assert
self
.
parent
is
not
None
,
str
(
self
)
...
...
Lib/lib2to3/tests/test_pytree.py
Dosyayı görüntüle @
1a5e5de8
...
@@ -31,23 +31,6 @@ class TestNodes(support.TestCase):
...
@@ -31,23 +31,6 @@ class TestNodes(support.TestCase):
"""Unit tests for nodes (Base, Leaf, Node)."""
"""Unit tests for nodes (Base, Leaf, Node)."""
if
sys
.
version_info
>=
(
2
,
6
):
# warnings.catch_warnings is new in 2.6.
def
test_deprecated_prefix_methods
(
self
):
l
=
pytree
.
Leaf
(
100
,
"foo"
)
with
warnings
.
catch_warnings
(
record
=
True
)
as
w
:
warnings
.
simplefilter
(
"always"
,
DeprecationWarning
)
self
.
assertEqual
(
l
.
get_prefix
(),
""
)
l
.
set_prefix
(
"hi"
)
self
.
assertEqual
(
l
.
prefix
,
"hi"
)
self
.
assertEqual
(
len
(
w
),
2
)
for
warning
in
w
:
self
.
assertTrue
(
warning
.
category
is
DeprecationWarning
)
self
.
assertEqual
(
str
(
w
[
0
]
.
message
),
"get_prefix() is deprecated; "
\
"use the prefix property"
)
self
.
assertEqual
(
str
(
w
[
1
]
.
message
),
"set_prefix() is deprecated; "
\
"use the prefix property"
)
def
test_instantiate_base
(
self
):
def
test_instantiate_base
(
self
):
if
__debug__
:
if
__debug__
:
# Test that instantiating Base() raises an AssertionError
# Test that instantiating Base() raises an AssertionError
...
...
Misc/NEWS
Dosyayı görüntüle @
1a5e5de8
...
@@ -24,6 +24,8 @@ Core and Builtins
...
@@ -24,6 +24,8 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
13248
:
Remove
lib2to3
.
pytree
.
Base
.
get_prefix
/
set_prefix
.
-
Issue
#
14234
:
CVE
-
2012
-
0876
:
Randomize
hashes
of
xml
attributes
in
the
hash
-
Issue
#
14234
:
CVE
-
2012
-
0876
:
Randomize
hashes
of
xml
attributes
in
the
hash
table
internal
to
the
pyexpat
module
's copy of the expat library to avoid a
table
internal
to
the
pyexpat
module
's copy of the expat library to avoid a
denial of service due to hash collisions. Patch by David Malcolm with some
denial of service due to hash collisions. Patch by David Malcolm with some
...
...
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