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
78c1871d
Kaydet (Commit)
78c1871d
authored
Mar 17, 2010
tarafından
Florent Xicluna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix and check cgi module deprecation warnings. Revert an unwanted rename in test_import.
üst
945a8ba6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
cgi.py
Lib/cgi.py
+5
-5
test_cgi.py
Lib/test/test_cgi.py
+6
-5
test_import.py
Lib/test/test_import.py
+1
-1
No files found.
Lib/cgi.py
Dosyayı görüntüle @
78c1871d
...
...
@@ -45,10 +45,10 @@ from warnings import filterwarnings, catch_warnings, warn
with
catch_warnings
():
if
sys
.
py3kwarning
:
filterwarnings
(
"ignore"
,
".*mimetools has been removed"
,
DeprecationWarning
)
DeprecationWarning
)
filterwarnings
(
"ignore"
,
".*rfc822 has been removed"
,
DeprecationWarning
)
import
mimetools
if
sys
.
py3kwarning
:
filterwarnings
(
"ignore"
,
".*rfc822 has been removed"
,
DeprecationWarning
)
import
rfc822
try
:
...
...
@@ -180,8 +180,8 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
def
parse_qs
(
qs
,
keep_blank_values
=
0
,
strict_parsing
=
0
):
"""Parse a query given as a string argument."""
warn
(
"cgi.parse_qs is deprecated, use urlparse.parse_qs
\
instead"
,
PendingDeprecationWarning
,
2
)
warn
(
"cgi.parse_qs is deprecated, use urlparse.parse_qs
instead"
,
PendingDeprecationWarning
,
2
)
return
urlparse
.
parse_qs
(
qs
,
keep_blank_values
,
strict_parsing
)
...
...
Lib/test/test_cgi.py
Dosyayı görüntüle @
78c1871d
...
...
@@ -4,7 +4,6 @@ import os
import
sys
import
tempfile
import
unittest
from
StringIO
import
StringIO
class
HackedSysModule
:
# The regression test will have real values in sys.argv, which
...
...
@@ -340,14 +339,16 @@ this is the content of the fake file
self
.
assertEqual
(
result
,
v
)
def
test_deprecated_parse_qs
(
self
):
with
check_warnings
(
quiet
=
False
):
# this func is moved to urlparse, this is just a sanity check
# this func is moved to urlparse, this is just a sanity check
with
check_warnings
((
'cgi.parse_qs is deprecated, use urlparse.'
'parse_qs instead'
,
PendingDeprecationWarning
)):
self
.
assertEqual
({
'a'
:
[
'A1'
],
'B'
:
[
'B3'
],
'b'
:
[
'B2'
]},
cgi
.
parse_qs
(
'a=A1&b=B2&B=B3'
))
def
test_deprecated_parse_qsl
(
self
):
with
check_warnings
(
quiet
=
False
):
# this func is moved to urlparse, this is just a sanity check
# this func is moved to urlparse, this is just a sanity check
with
check_warnings
((
'cgi.parse_qsl is deprecated, use urlparse.'
'parse_qsl instead'
,
PendingDeprecationWarning
)):
self
.
assertEqual
([(
'a'
,
'A1'
),
(
'b'
,
'B2'
),
(
'B'
,
'B3'
)],
cgi
.
parse_qsl
(
'a=A1&b=B2&B=B3'
))
...
...
Lib/test/test_import.py
Dosyayı görüntüle @
78c1871d
...
...
@@ -162,7 +162,7 @@ class ImportTests(unittest.TestCase):
unlink
(
filename
+
'c'
)
unlink
(
filename
+
'o'
)
def
test_
0B
failing_import_sticks
(
self
):
def
test_failing_import_sticks
(
self
):
source
=
TESTFN
+
os
.
extsep
+
"py"
with
open
(
source
,
"w"
)
as
f
:
print
>>
f
,
"a = 1 // 0"
...
...
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