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
9ac3974d
Kaydet (Commit)
9ac3974d
authored
May 09, 2008
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Deprecate the pure module for 3.0.
üst
1aed624f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
test_py3kwarn.py
Lib/test/test_py3kwarn.py
+10
-1
NEWS
Misc/NEWS
+2
-0
puremodule.c
Modules/puremodule.c
+4
-0
No files found.
Lib/test/test_py3kwarn.py
Dosyayı görüntüle @
9ac3974d
...
...
@@ -129,8 +129,9 @@ class TestStdlibRemovals(unittest.TestCase):
# test.testall not tested as it executes all unit tests as an
# import side-effect.
all_platforms
=
(
'audiodev'
,
'imputil'
,
'mutex'
,
'user'
,
'new'
)
inclusive_platforms
=
{
'irix'
:(
'pure'
,)}
def
check_removal
(
self
,
module_name
):
def
check_removal
(
self
,
module_name
,
optional
=
False
):
"""Make sure the specified module, when imported, raises a
DeprecationWarning and specifies itself in the message."""
original_module
=
None
...
...
@@ -145,6 +146,9 @@ class TestStdlibRemovals(unittest.TestCase):
__import__
(
module_name
,
level
=
0
)
except
DeprecationWarning
as
exc
:
self
.
assert_
(
module_name
in
exc
.
args
[
0
])
except
ImportError
:
if
not
optional
:
raise
else
:
self
.
fail
(
"DeprecationWarning not raised for
%
s"
%
module_name
)
...
...
@@ -159,6 +163,11 @@ class TestStdlibRemovals(unittest.TestCase):
for
module_name
in
self
.
all_platforms
:
self
.
check_removal
(
module_name
)
def
test_platform_specific_removals
(
self
):
# Test the removal of platform-specific modules.
for
module_name
in
self
.
inclusive_platforms
.
get
(
sys
.
platform
,
[]):
self
.
check_removal
(
module_name
,
optional
=
True
)
def
test_os_path_walk
(
self
):
msg
=
"In 3.x, os.path.walk is removed in favor of os.walk."
def
dumbo
(
where
,
names
,
args
):
pass
...
...
Misc/NEWS
Dosyayı görüntüle @
9ac3974d
...
...
@@ -23,6 +23,8 @@ Extension Modules
Library
-------
- The pure module has been deprecated for removal in Python 3.0.
- Issue #2487: change the semantics of math.ldexp(x, n) when n is too
large to fit in a C long. ldexp(x, n) now returns a zero (with
suitable sign) if n is large and negative; previously, it raised
...
...
Modules/puremodule.c
Dosyayı görüntüle @
9ac3974d
...
...
@@ -951,6 +951,10 @@ initpure()
{
PyObject
*
m
,
*
d
;
if
(
PyErr_WarnPy3k
(
"the pure module has been removed in "
"Python 3.0"
,
2
)
<
0
)
return
;
m
=
Py_InitModule
(
"pure"
,
pure_methods
);
if
(
m
==
NULL
)
return
;
...
...
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