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
f03bcfd1
Kaydet (Commit)
f03bcfd1
authored
Eyl 09, 2016
tarafından
R David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge: #27630: Be consistent in how _XXX/_encoded_XXX vars are initialized.
üst
71c01d43
eaab1ca5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
generator.py
Lib/email/generator.py
+1
-9
No files found.
Lib/email/generator.py
Dosyayı görüntüle @
f03bcfd1
...
@@ -97,7 +97,7 @@ class Generator:
...
@@ -97,7 +97,7 @@ class Generator:
self
.
_NL
=
policy
.
linesep
self
.
_NL
=
policy
.
linesep
self
.
_encoded_NL
=
self
.
_encode
(
self
.
_NL
)
self
.
_encoded_NL
=
self
.
_encode
(
self
.
_NL
)
self
.
_EMPTY
=
''
self
.
_EMPTY
=
''
self
.
_encoded_EMPTY
=
self
.
_encode
(
''
)
self
.
_encoded_EMPTY
=
self
.
_encode
(
self
.
_EMPTY
)
# Because we use clone (below) when we recursively process message
# Because we use clone (below) when we recursively process message
# subparts, and because clone uses the computed policy (not None),
# subparts, and because clone uses the computed policy (not None),
# submessages will automatically get set to the computed policy when
# submessages will automatically get set to the computed policy when
...
@@ -137,10 +137,6 @@ class Generator:
...
@@ -137,10 +137,6 @@ class Generator:
# it has already transformed the input; but, since this whole thing is a
# it has already transformed the input; but, since this whole thing is a
# hack anyway this seems good enough.
# hack anyway this seems good enough.
# Similarly, we have _XXX and _encoded_XXX attributes that are used on
# source and buffer data, respectively.
_encoded_EMPTY
=
''
def
_new_buffer
(
self
):
def
_new_buffer
(
self
):
# BytesGenerator overrides this to return BytesIO.
# BytesGenerator overrides this to return BytesIO.
return
StringIO
()
return
StringIO
()
...
@@ -402,10 +398,6 @@ class BytesGenerator(Generator):
...
@@ -402,10 +398,6 @@ class BytesGenerator(Generator):
The outfp object must accept bytes in its write method.
The outfp object must accept bytes in its write method.
"""
"""
# Bytes versions of this constant for use in manipulating data from
# the BytesIO buffer.
_encoded_EMPTY
=
b
''
def
write
(
self
,
s
):
def
write
(
self
,
s
):
self
.
_fp
.
write
(
s
.
encode
(
'ascii'
,
'surrogateescape'
))
self
.
_fp
.
write
(
s
.
encode
(
'ascii'
,
'surrogateescape'
))
...
...
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