Skip to content

Commit

Permalink
fix py24 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Dec 9, 2010
1 parent e3d6683 commit da8fa1c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions slave/buildslave/commands/repo.py
Expand Up @@ -5,7 +5,11 @@
from buildslave.commands.base import SourceBaseCommand
from buildslave import runprocess

import hashlib
try:
from hashlib import sha1
except ImportError:
import sha
sha1 = sha.new

class Repo(SourceBaseCommand):
"""Repo specific VC operation. In addition to the arguments
Expand Down Expand Up @@ -141,6 +145,6 @@ def _doDownload(self, dummy):
def parseGotRevision(self):
command = ['manifest', '-o', '-']
def _parse(res):
return hashlib.sha1(self.command.stdout).hexdigest()
return sha1(self.command.stdout).hexdigest()
return self._repoCmd(command, _parse, keepStdout=True)

0 comments on commit da8fa1c

Please sign in to comment.