1 From a8791e3dca61500a382be84dc96973639b8bd182 Mon Sep 17 00:00:00 2001
2 From: Jose Fonseca <jfonseca@vmware.com>
3 Date: Sun, 28 Apr 2019 14:13:01 +0100
4 Subject: [PATCH 2/4] specs: Tie Python 2 ->3 conversion loose ends.
6 Upstream-Status: Backport [https://github.com/apitrace/apitrace/commit/5b3c68cafaddc82c0f34bea8127582eee07ac3be]
8 (cherry picked from commit 5b3c68cafaddc82c0f34bea8127582eee07ac3be)
9 Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
11 specs/scripts/Makefile | 16 ++++++++--------
12 specs/scripts/c2api.py | 6 +++---
13 specs/scripts/cxx2api.py | 2 +-
14 specs/scripts/spec2api.py | 2 +-
15 specs/scripts/txt2api.py | 8 +++++---
16 specs/scripts/xml2api.py | 2 +-
17 specs/scripts/xml2enum.py | 2 +-
18 specs/scripts/xml2glparams.py | 2 +-
19 8 files changed, 21 insertions(+), 19 deletions(-)
21 diff --git a/specs/scripts/Makefile b/specs/scripts/Makefile
22 index 714a3deb..f03f36eb 100644
23 --- a/specs/scripts/Makefile
24 +++ b/specs/scripts/Makefile
25 @@ -37,28 +37,28 @@ download: \
26 wget -N https://www.opengl.org/registry/oldspecs/$@
28 glapi.py: xml2api.py gl.xml
32 glxapi.py: xml2api.py glx.xml
36 wglapi.py: xml2api.py wgl.xml
40 eglapi.py: xml2api.py egl.xml
44 glparams.py: xml2glparams.py gl.xml
48 glxenum.py: xml2enum.py glx.xml
52 wglenum.py: xml2enum.py wgl.xml
56 eglenum.py: xml2enum.py egl.xml
62 diff --git a/specs/scripts/c2api.py b/specs/scripts/c2api.py
63 index b8aaa81d..208169d2 100755
64 --- a/specs/scripts/c2api.py
65 +++ b/specs/scripts/c2api.py
67 -#!/usr/bin/env python
68 +#!/usr/bin/env python3
69 ##########################################################################
71 # Copyright 2011 Jose Fonseca
72 @@ -404,8 +404,8 @@ class DeclParser:
79 + type = 'Long' * long
83 diff --git a/specs/scripts/cxx2api.py b/specs/scripts/cxx2api.py
84 index 9720615d..8056de47 100755
85 --- a/specs/scripts/cxx2api.py
86 +++ b/specs/scripts/cxx2api.py
88 -#!/usr/bin/env python
89 +#!/usr/bin/env python3
93 diff --git a/specs/scripts/spec2api.py b/specs/scripts/spec2api.py
94 index 7fb395a4..33a8d058 100755
95 --- a/specs/scripts/spec2api.py
96 +++ b/specs/scripts/spec2api.py
98 -#!/usr/bin/env python
99 +#!/usr/bin/env python3
100 ##########################################################################
102 # Copyright 2010 VMware, Inc.
103 diff --git a/specs/scripts/txt2api.py b/specs/scripts/txt2api.py
104 index e9469d3c..a32ca658 100755
105 --- a/specs/scripts/txt2api.py
106 +++ b/specs/scripts/txt2api.py
108 -#!/usr/bin/env python
109 +#!/usr/bin/env python3
110 ##########################################################################
112 # Copyright 2010 VMware, Inc.
114 """Parser for OpenGL .txt extensions specification."""
121 @@ -233,12 +234,13 @@ def main():
124 if arg.startswith('http://') or arg.startswith('https://'):
125 - stream = urlopen(arg, 'rt')
126 + stream = urlopen(arg)
127 + stream = io.TextIOWrapper(stream, encoding='ascii')
129 stream = open(arg, 'rt')
130 parser = TxtParser(stream, prefix = options.prefix)
135 if __name__ == '__main__':
137 diff --git a/specs/scripts/xml2api.py b/specs/scripts/xml2api.py
138 index f09fe0bf..6b4ec3b7 100755
139 --- a/specs/scripts/xml2api.py
140 +++ b/specs/scripts/xml2api.py
142 -#!/usr/bin/env python
143 +#!/usr/bin/env python3
144 ##########################################################################
146 # Copyright 2014 VMware, Inc
147 diff --git a/specs/scripts/xml2enum.py b/specs/scripts/xml2enum.py
148 index cb2c4ae9..f799b7b5 100755
149 --- a/specs/scripts/xml2enum.py
150 +++ b/specs/scripts/xml2enum.py
152 -#!/usr/bin/env python
153 +#!/usr/bin/env python3
154 ##########################################################################
156 # Copyright 2014 VMware, Inc
157 diff --git a/specs/scripts/xml2glparams.py b/specs/scripts/xml2glparams.py
158 index 805aac86..a651d896 100755
159 --- a/specs/scripts/xml2glparams.py
160 +++ b/specs/scripts/xml2glparams.py
162 -#!/usr/bin/env python
163 +#!/usr/bin/env python3
164 ##########################################################################
166 # Copyright 2014 VMware, Inc