Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r15247 - main/branches/2.1.7/bin
Date: Fri, 29 Jan 2010 18:48:02
Message-Id: E1Navst-0006h3-Hr@stork.gentoo.org
1 Author: zmedico
2 Date: 2010-01-29 18:47:59 +0000 (Fri, 29 Jan 2010)
3 New Revision: 15247
4
5 Modified:
6 main/branches/2.1.7/bin/check-implicit-pointer-usage.py
7 Log:
8 Avoid potential UnicodeDecodeError with Python 3. Reported by devurandom.
9 (trunk r15192)
10
11 Modified: main/branches/2.1.7/bin/check-implicit-pointer-usage.py
12 ===================================================================
13 --- main/branches/2.1.7/bin/check-implicit-pointer-usage.py 2010-01-29 18:47:51 UTC (rev 15246)
14 +++ main/branches/2.1.7/bin/check-implicit-pointer-usage.py 2010-01-29 18:47:59 UTC (rev 15247)
15 @@ -19,6 +19,8 @@
16 import re
17 import sys
18
19 +from portage import _unicode_decode
20 +
21 implicit_pattern = re.compile("([^:]*):(\d+): warning: implicit declaration "
22 + "of function [`']([^']*)'")
23 pointer_pattern = re.compile(
24 @@ -37,7 +39,10 @@
25 last_implicit_func = ""
26
27 while True:
28 - line = sys.stdin.readline()
29 + if sys.hexversion >= 0x3000000:
30 + line = _unicode_decode(sys.stdin.buffer.readline())
31 + else:
32 + line = sys.stdin.readline()
33 if line == '':
34 break
35 # translate unicode open/close quotes to ascii ones