Patchwork [2,of,5] tests: test-archive.t use open() instead of file() for py3 compat

login
register
mail settings
Submitter timeless
Date May 11, 2016, 5:21 a.m.
Message ID <4863c4335adb884356b4.1462944063@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/14999/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

timeless - May 11, 2016, 5:21 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1462562176 0
#      Fri May 06 19:16:16 2016 +0000
# Node ID 4863c4335adb884356b47339c37bec543c889a95
# Parent  5e44aad4d3f93555d9ea24bb90074b58e232eec4
# EXP-Topic runtests
# Available At bb://timeless/mercurial-crew
#              hg pull bb://timeless/mercurial-crew -r 4863c4335adb
tests: test-archive.t use open() instead of file() for py3 compat

Patch

diff -r 5e44aad4d3f9 -r 4863c4335adb tests/test-archive.t
--- a/tests/test-archive.t	Fri May 06 19:15:37 2016 +0000
+++ b/tests/test-archive.t	Fri May 06 19:16:16 2016 +0000
@@ -202,8 +202,8 @@ 
   >     from md5 import md5
   > import sys
   > f1, f2 = sys.argv[1:3]
-  > h1 = md5(file(f1, 'rb').read()).hexdigest()
-  > h2 = md5(file(f2, 'rb').read()).hexdigest()
+  > h1 = md5(open(f1, 'rb').read()).hexdigest()
+  > h2 = md5(open(f2, 'rb').read()).hexdigest()
   > print(h1 == h2 or "md5 differ: " + repr((h1, h2)))
   > EOF