1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-27 23:16:14 +01:00
- other fixes for python26
This commit is contained in:
Marcus Hüwe 2008-09-21 14:44:20 +00:00
parent 35a5c21dab
commit 6ddace8c97
2 changed files with 11 additions and 6 deletions

View File

@ -271,8 +271,8 @@ class RawCmdln(cmd.Cmd):
Returns the return value from the command handler. Returns the return value from the command handler.
""" """
assert (isinstance(argv, (list, tuple)), assert isinstance(argv, (list, tuple)), \
"'argv' is not a sequence: %r" % argv) "'argv' is not a sequence: %r" % argv
retval = None retval = None
try: try:
argv = self.precmd(argv) argv = self.precmd(argv)
@ -317,8 +317,8 @@ class RawCmdln(cmd.Cmd):
while not self.stop: while not self.stop:
if self.cmdqueue: if self.cmdqueue:
argv = self.cmdqueue.pop(0) argv = self.cmdqueue.pop(0)
assert (isinstance(argv, (list, tuple)), assert isinstance(argv, (list, tuple)), \
"item on 'cmdqueue' is not a sequence: %r" % argv) "item on 'cmdqueue' is not a sequence: %r" % argv
else: else:
if self.use_rawinput: if self.use_rawinput:
try: try:

View File

@ -2091,8 +2091,13 @@ def dgst(file):
#if not os.path.exists(file): #if not os.path.exists(file):
#return None #return None
import md5 try:
s = md5.new() import hashlib
md5 = hashlib
except ImportError:
import md5
md5 = md5
s = md5.md5()
f = open(file, 'r') f = open(file, 'r')
while 1: while 1:
buf = f.read(BUFSIZE) buf = f.read(BUFSIZE)