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
3aa84a7f
Kaydet (Commit)
3aa84a7f
authored
May 26, 2008
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
warn about some members of the commands module
üst
b17ad2de
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
commands.rst
Doc/library/commands.rst
+7
-1
commands.py
Lib/commands.py
+4
-0
test_py3kwarn.py
Lib/test/test_py3kwarn.py
+9
-0
No files found.
Doc/library/commands.rst
Dosyayı görüntüle @
3aa84a7f
...
...
@@ -42,7 +42,13 @@ The :mod:`commands` module defines the following functions:
.. deprecated:: 2.6
This function is nonobvious and useless, also the name is misleading in the
presence of :func:`getstatusoutput`.
presence of :func:`getstatusoutput`. It is removed in 3.x.
.. warning::
Two undocumented functions in this module, :func:`mk2arg` and :func:`mkargs`
are removed in 3.x.
Example::
...
...
Lib/commands.py
Dosyayı görüntüle @
3aa84a7f
...
...
@@ -63,6 +63,8 @@ def getstatusoutput(cmd):
# Make command argument from directory and pathname (prefix space, add quotes).
#
def
mk2arg
(
head
,
x
):
from
warnings
import
warnpy3k
warnpy3k
(
"In 3.x, mk2arg is removed."
)
import
os
return
mkarg
(
os
.
path
.
join
(
head
,
x
))
...
...
@@ -75,6 +77,8 @@ def mk2arg(head, x):
# with backslash.
#
def
mkarg
(
x
):
from
warnings
import
warnpy3k
warnpy3k
(
"in 3.x, mkarg is remove."
)
if
'
\'
'
not
in
x
:
return
'
\'
'
+
x
+
'
\'
'
s
=
' "'
...
...
Lib/test/test_py3kwarn.py
Dosyayı görüntüle @
3aa84a7f
...
...
@@ -212,6 +212,15 @@ class TestStdlibRemovals(unittest.TestCase):
mod
.
walk
(
"."
,
dumbo
,
None
)
self
.
assertEquals
(
str
(
w
.
message
),
msg
)
def
test_commands_members
(
self
):
import
commands
members
=
{
"mk2arg"
:
2
,
"mkarg"
:
1
,
"getstatus"
:
1
}
for
name
,
arg_count
in
members
.
items
():
with
catch_warning
(
record
=
False
):
warnings
.
filterwarnings
(
"error"
)
func
=
getattr
(
commands
,
name
)
self
.
assertRaises
(
DeprecationWarning
,
func
,
*
([
None
]
*
arg_count
))
def
test_main
():
run_unittest
(
TestPy3KWarnings
,
...
...
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