[PATCH 7 of 7] py3: use open() instead of file() constructor

Pulkit Goyal 7895pulkit at gmail.com
Sat Jun 17 08:45:25 EDT 2017


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1497699988 -19800
#      Sat Jun 17 17:16:28 2017 +0530
# Node ID bfd8dddf91ee12066e6bda973060aac2a64f82b1
# Parent  46301f911f32d24da71dc25ac9dde01e537e3f24
py3: use open() instead of file() constructor

The file() constructor has been removed in python 3.

diff --git a/tests/f b/tests/f
--- a/tests/f
+++ b/tests/f
@@ -51,7 +51,7 @@
             if opts.type:
                 facts.append('file')
             if opts.hexdump or opts.dump or opts.md5:
-                content = file(f, 'rb').read()
+                content = open(f, 'rb').read()
         elif islink:
             if opts.type:
                 facts.append('link')


More information about the Mercurial-devel mailing list