From 6ddace8c97d65a3542e522a2c140e2fcf78e8265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20H=C3=BCwe?= Date: Sun, 21 Sep 2008 14:44:20 +0000 Subject: [PATCH] - fixed #426612 - other fixes for python26 --- osc/cmdln.py | 8 ++++---- osc/core.py | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/osc/cmdln.py b/osc/cmdln.py index deadf230..8a8a50bc 100644 --- a/osc/cmdln.py +++ b/osc/cmdln.py @@ -271,8 +271,8 @@ class RawCmdln(cmd.Cmd): Returns the return value from the command handler. """ - assert (isinstance(argv, (list, tuple)), - "'argv' is not a sequence: %r" % argv) + assert isinstance(argv, (list, tuple)), \ + "'argv' is not a sequence: %r" % argv retval = None try: argv = self.precmd(argv) @@ -317,8 +317,8 @@ class RawCmdln(cmd.Cmd): while not self.stop: if self.cmdqueue: argv = self.cmdqueue.pop(0) - assert (isinstance(argv, (list, tuple)), - "item on 'cmdqueue' is not a sequence: %r" % argv) + assert isinstance(argv, (list, tuple)), \ + "item on 'cmdqueue' is not a sequence: %r" % argv else: if self.use_rawinput: try: diff --git a/osc/core.py b/osc/core.py index 910162ca..bbc7b18f 100755 --- a/osc/core.py +++ b/osc/core.py @@ -2091,8 +2091,13 @@ def dgst(file): #if not os.path.exists(file): #return None - import md5 - s = md5.new() + try: + import hashlib + md5 = hashlib + except ImportError: + import md5 + md5 = md5 + s = md5.md5() f = open(file, 'r') while 1: buf = f.read(BUFSIZE)