Mercurial > hg
comparison tests/test-check-help.t @ 35949:80e5210df25c
py3: make sure we open the file in bytes mode
# skip-blame because we are just adding b
Differential Revision: https://phab.mercurial-scm.org/D2077
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 07 Feb 2018 13:49:02 +0530 |
parents | a36d3c8a0e41 |
children | d2c81e83de2a |
comparison
equal
deleted
inserted
replaced
35948:f87641bf4d23 | 35949:80e5210df25c |
---|---|
10 > import os, msvcrt | 10 > import os, msvcrt |
11 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) | 11 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
12 > topics = set() | 12 > topics = set() |
13 > topicre = re.compile(br':hg:`help ([a-z0-9\-.]+)`') | 13 > topicre = re.compile(br':hg:`help ([a-z0-9\-.]+)`') |
14 > for fname in sys.argv: | 14 > for fname in sys.argv: |
15 > with open(fname) as f: | 15 > with open(fname, 'rb') as f: |
16 > topics.update(m.group(1) for m in topicre.finditer(f.read())) | 16 > topics.update(m.group(1) for m in topicre.finditer(f.read())) |
17 > for s in sorted(topics): | 17 > for s in sorted(topics): |
18 > print(s) | 18 > print(s) |
19 > EOF | 19 > EOF |
20 | 20 |