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
ec8e7168
Kaydet (Commit)
ec8e7168
authored
Agu 08, 2007
tarafından
Collin Winter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Convert some usages of types.StringType to just str (since types.StringType has gone away).
üst
3045c7c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
handlers.py
Lib/wsgiref/handlers.py
+4
-5
No files found.
Lib/wsgiref/handlers.py
Dosyayı görüntüle @
ec8e7168
"""Base classes for server/gateway implementations"""
"""Base classes for server/gateway implementations"""
from
types
import
StringType
from
.util
import
FileWrapper
,
guess_scheme
,
is_hop_by_hop
from
.util
import
FileWrapper
,
guess_scheme
,
is_hop_by_hop
from
.headers
import
Headers
from
.headers
import
Headers
...
@@ -158,14 +157,14 @@ class BaseHandler:
...
@@ -158,14 +157,14 @@ class BaseHandler:
elif
self
.
headers
is
not
None
:
elif
self
.
headers
is
not
None
:
raise
AssertionError
(
"Headers already set!"
)
raise
AssertionError
(
"Headers already set!"
)
assert
type
(
status
)
is
StringType
,
"Status must be a string"
assert
type
(
status
)
is
str
,
"Status must be a string"
assert
len
(
status
)
>=
4
,
"Status must be at least 4 characters"
assert
len
(
status
)
>=
4
,
"Status must be at least 4 characters"
assert
int
(
status
[:
3
]),
"Status message must begin w/3-digit code"
assert
int
(
status
[:
3
]),
"Status message must begin w/3-digit code"
assert
status
[
3
]
==
" "
,
"Status message must have a space after code"
assert
status
[
3
]
==
" "
,
"Status message must have a space after code"
if
__debug__
:
if
__debug__
:
for
name
,
val
in
headers
:
for
name
,
val
in
headers
:
assert
type
(
name
)
is
StringType
,
"Header names must be strings"
assert
type
(
name
)
is
str
,
"Header names must be strings"
assert
type
(
val
)
is
StringType
,
"Header values must be strings"
assert
type
(
val
)
is
str
,
"Header values must be strings"
assert
not
is_hop_by_hop
(
name
),
"Hop-by-hop headers not allowed"
assert
not
is_hop_by_hop
(
name
),
"Hop-by-hop headers not allowed"
self
.
status
=
status
self
.
status
=
status
self
.
headers
=
self
.
headers_class
(
headers
)
self
.
headers
=
self
.
headers_class
(
headers
)
...
@@ -189,7 +188,7 @@ class BaseHandler:
...
@@ -189,7 +188,7 @@ class BaseHandler:
def
write
(
self
,
data
):
def
write
(
self
,
data
):
"""'write()' callable as specified by PEP 333"""
"""'write()' callable as specified by PEP 333"""
assert
type
(
data
)
is
StringType
,
"write() argument must be string"
assert
type
(
data
)
is
str
,
"write() argument must be string"
if
not
self
.
status
:
if
not
self
.
status
:
raise
AssertionError
(
"write() before start_response()"
)
raise
AssertionError
(
"write() before start_response()"
)
...
...
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