File: py-encoding.diff

package info (click to toggle)
gcc-python-plugin 0.17-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 46,268 kB
  • sloc: python: 15,434; ansic: 11,462; makefile: 576; xml: 449; cpp: 137; pascal: 75; sh: 7
file content (28 lines) | stat: -rw-r--r-- 917 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Index: b/run-test-suite.py
===================================================================
--- a/run-test-suite.py
+++ b/run-test-suite.py
@@ -327,8 +327,12 @@ def run_test(testdir):
     # uses Python.h:
     def uses_python_headers():
         for inputfile in inputfiles:
-            with open(inputfile, 'r') as f:
-                code = f.read()
+            if six.PY3:
+                with open(inputfile, 'r', encoding='utf-8') as f:
+                    code = f.read()
+            else:
+                with open(inputfile, 'r') as f:
+                    code = f.read()
             if '#include <Python.h>' in code:
                 return True
 
@@ -777,7 +781,7 @@ class TestRunner:
                               num(len(self.skipped_tests), "skipped", "skipped")))
 
 tr = TestRunner()
-if 1:
+if 0:
     tr.run_tests_in_parallel(sorted(testdirs))
 else:
     tr.run_tests(sorted(testdirs))