Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(25040)

Unified Diff: Lib/bz2.py

Issue 16034: bz2 module appears slower in Python 3.x versus Python 2.x
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/bz2.py Mon Oct 01 00:04:46 2012 +0200
+++ b/Lib/bz2.py Mon Oct 01 01:35:33 2012 +0300
@@ -159,21 +159,18 @@
raise ValueError("I/O operation on closed file")
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):
+ self._check_not_closed()
raise io.UnsupportedOperation("File not open for reading")
def _check_can_write(self):
- if self.closed:
- raise ValueError("I/O operation on closed file")
if self._mode != _MODE_WRITE:
+ self._check_not_closed()
raise io.UnsupportedOperation("File not open for writing")
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):
+ self._check_not_closed()
raise io.UnsupportedOperation("Seeking is only supported "
"on files open for reading")
if not self._fp.seekable():
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+