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
452add08
Kaydet (Commit)
452add08
authored
Eki 01, 2012
tarafından
Nadeem Vawda
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #16304: Another performance optimization for BZ2File.
Patch by Serhiy Storchaka.
üst
4524b467
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
bz2.py
Lib/bz2.py
+3
-6
No files found.
Lib/bz2.py
Dosyayı görüntüle @
452add08
...
@@ -159,21 +159,18 @@ class BZ2File(io.BufferedIOBase):
...
@@ -159,21 +159,18 @@ class BZ2File(io.BufferedIOBase):
raise
ValueError
(
"I/O operation on closed file"
)
raise
ValueError
(
"I/O operation on closed file"
)
def
_check_can_read
(
self
):
def
_check_can_read
(
self
):
if
self
.
closed
:
raise
ValueError
(
"I/O operation on closed file"
)
if
self
.
_mode
not
in
(
_MODE_READ
,
_MODE_READ_EOF
):
if
self
.
_mode
not
in
(
_MODE_READ
,
_MODE_READ_EOF
):
self
.
_check_not_closed
()
raise
io
.
UnsupportedOperation
(
"File not open for reading"
)
raise
io
.
UnsupportedOperation
(
"File not open for reading"
)
def
_check_can_write
(
self
):
def
_check_can_write
(
self
):
if
self
.
closed
:
raise
ValueError
(
"I/O operation on closed file"
)
if
self
.
_mode
!=
_MODE_WRITE
:
if
self
.
_mode
!=
_MODE_WRITE
:
self
.
_check_not_closed
()
raise
io
.
UnsupportedOperation
(
"File not open for writing"
)
raise
io
.
UnsupportedOperation
(
"File not open for writing"
)
def
_check_can_seek
(
self
):
def
_check_can_seek
(
self
):
if
self
.
closed
:
raise
ValueError
(
"I/O operation on closed file"
)
if
self
.
_mode
not
in
(
_MODE_READ
,
_MODE_READ_EOF
):
if
self
.
_mode
not
in
(
_MODE_READ
,
_MODE_READ_EOF
):
self
.
_check_not_closed
()
raise
io
.
UnsupportedOperation
(
"Seeking is only supported "
raise
io
.
UnsupportedOperation
(
"Seeking is only supported "
"on files open for reading"
)
"on files open for reading"
)
if
not
self
.
_fp
.
seekable
():
if
not
self
.
_fp
.
seekable
():
...
...
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