Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
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
django
Commits
c28281f9
Kaydet (Commit)
c28281f9
authored
May 21, 2013
tarafından
Łukasz Langa
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed a Python 2.6 regression (GzipFile can't act as a context manager)
üst
b1ac241d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
tests.py
tests/http_utils/tests.py
+4
-1
No files found.
tests/http_utils/tests.py
Dosyayı görüntüle @
c28281f9
...
@@ -11,8 +11,11 @@ from django.test import TestCase
...
@@ -11,8 +11,11 @@ from django.test import TestCase
# based on Python 3.3's gzip.compress
# based on Python 3.3's gzip.compress
def
gzip_compress
(
data
):
def
gzip_compress
(
data
):
buf
=
io
.
BytesIO
()
buf
=
io
.
BytesIO
()
with
gzip
.
GzipFile
(
fileobj
=
buf
,
mode
=
'wb'
,
compresslevel
=
0
)
as
f
:
f
=
gzip
.
GzipFile
(
fileobj
=
buf
,
mode
=
'wb'
,
compresslevel
=
0
)
try
:
f
.
write
(
data
)
f
.
write
(
data
)
finally
:
f
.
close
()
return
buf
.
getvalue
()
return
buf
.
getvalue
()
...
...
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