Skip to content

Commit

Permalink
Remove bz2.BZ2File workaround for versions less than python-2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
krajaratnam committed Jan 30, 2010
1 parent 1f7c707 commit 58d2fa4
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions buildbot/status/builder.py
Expand Up @@ -12,11 +12,7 @@
import gc
from cPickle import load, dump
from cStringIO import StringIO

try: # bz2 is not available on py23
from bz2 import BZ2File
except ImportError:
BZ2File = None
from bz2 import BZ2File

try:
from gzip import GzipFile
Expand Down Expand Up @@ -304,11 +300,11 @@ def getFile(self):
return self.openfile
# otherwise they get their own read-only handle
# try a compressed log first
if BZ2File is not None:
try:
return BZ2File(self.getFilename() + ".bz2", "r")
except IOError:
pass
try:
return BZ2File(self.getFilename() + ".bz2", "r")
except IOError:
pass

if GzipFile is not None:
try:
return GzipFile(self.getFilename() + ".gz", "r")
Expand Down Expand Up @@ -521,8 +517,6 @@ def finish(self):
def compressLog(self):
# bail out if there's no compression support
if self.compressMethod == "bz2":
if BZ2File is None:
return
compressed = self.getFilename() + ".bz2.tmp"
elif self.compressMethod == "gz":
if GzipFile is None:
Expand Down

0 comments on commit 58d2fa4

Please sign in to comment.