Mercurial > hg
comparison tests/test-archive.t @ 29178:0fb2fddd00a3
tests: test-archive.t use open() instead of file() for py3 compat
author | timeless <timeless@mozdev.org> |
---|---|
date | Fri, 06 May 2016 19:16:16 +0000 |
parents | df6b5c6d252a |
children | ce1c6ab15807 |
comparison
equal
deleted
inserted
replaced
29177:df6b5c6d252a | 29178:0fb2fddd00a3 |
---|---|
200 > from hashlib import md5 | 200 > from hashlib import md5 |
201 > except ImportError: | 201 > except ImportError: |
202 > from md5 import md5 | 202 > from md5 import md5 |
203 > import sys | 203 > import sys |
204 > f1, f2 = sys.argv[1:3] | 204 > f1, f2 = sys.argv[1:3] |
205 > h1 = md5(file(f1, 'rb').read()).hexdigest() | 205 > h1 = md5(open(f1, 'rb').read()).hexdigest() |
206 > h2 = md5(file(f2, 'rb').read()).hexdigest() | 206 > h2 = md5(open(f2, 'rb').read()).hexdigest() |
207 > print(h1 == h2 or "md5 differ: " + repr((h1, h2))) | 207 > print(h1 == h2 or "md5 differ: " + repr((h1, h2))) |
208 > EOF | 208 > EOF |
209 | 209 |
210 archive name is stored in the archive, so create similar archives and | 210 archive name is stored in the archive, so create similar archives and |
211 rename them afterwards. | 211 rename them afterwards. |