Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit c6c7cb5

Browse files
bryteisexhaihao
authored andcommitted
Check for python3 rather than python2
With python2 being deprecated, it makes sense to switch gpp.py to be python3 compatable and the build system to look for python3 rather than python2.
1 parent 2bf45e9 commit c6c7cb5

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ AC_HEADER_STDC
7777
AC_SYS_LARGEFILE
7878
AC_CHECK_LIB([m], [sin])
7979
AC_CHECK_FUNCS([log2f])
80-
AC_CHECK_PROGS([PYTHON2], [python2 python])
80+
AC_CHECK_PROGS([PYTHON3], [python3 python])
8181

8282
LIBVA_PACKAGE_VERSION=libva_package_version
8383
AC_SUBST(LIBVA_PACKAGE_VERSION)

src/shaders/gpp.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __parse_init(self, init):
6464
self.param_init = []
6565
for ini in inits:
6666
try:
67-
val = eval(ini)
67+
val = int(eval(ini))
6868
self.param_init.append(val)
6969
except:
7070
raise Exception(self.__errmsg('non an exp: %s'%ini))
@@ -80,7 +80,7 @@ def __parse_cond(self, cond):
8080
self.param_op = cond[0]
8181
limit = cond[1:]
8282
try:
83-
self.param_limit = eval(limit)
83+
self.param_limit = int(eval(limit))
8484
except:
8585
raise Exception(self.__errmsg('non an exp: %s'%limit))
8686
else:
@@ -172,13 +172,13 @@ def do_writeblock(block, curs):
172172
if __name__ == '__main__':
173173
argc = len(sys.argv)
174174
if argc == 1:
175-
print >>sys.stderr, 'no input file'
175+
print('no input file')
176176
sys.exit(0)
177177

178178
try:
179179
infile = open(sys.argv[1], 'r')
180180
except IOError:
181-
print >>sys.stderr, 'can not open %s' % sys.argv[1]
181+
print('can not open %s' % sys.argv[1])
182182
sys.exit(1)
183183

184184
if argc == 2:
@@ -187,7 +187,7 @@ def do_writeblock(block, curs):
187187
try:
188188
outfile = open(sys.argv[2], 'w')
189189
except IOError:
190-
print >>sys.stderr, 'can not write to %s' % sys.argv[2]
190+
print('can not write to %s' % sys.argv[2])
191191
sys.exit(1)
192192

193193
lines = readlines(infile)

src/shaders/h264/mc/Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,12 @@ if HAVE_GEN4ASM
189189

190190
$(INTEL_MC_GEN5_ASM): $(INTEL_MC_ASM) $(INTEL_MC_INC) $(INTEL_ILDB_ASM)
191191
$(AM_V_GEN)cpp -DDEV_ILK -DBOOTSTRAP -I $(srcdir)/../ildb/ $(srcdir)/AllAVC.asm > _mc0.$@ && \
192-
$(PYTHON2) $(top_srcdir)/src/shaders/gpp.py _mc0.$@ $@ && \
192+
$(PYTHON3) $(top_srcdir)/src/shaders/gpp.py _mc0.$@ $@ && \
193193
$(GEN4ASM) -l $(srcdir)/list -a -e tmp.$(INTEL_MC_EXPORT_GEN5) -g 5 $@ \
194194
-o /dev/null && \
195195
mv tmp.$(INTEL_MC_EXPORT_GEN5) $(INTEL_MC_EXPORT_GEN5) && \
196196
cpp -DDEV_ILK -I $(srcdir)/../ildb/ $(srcdir)/AllAVC.asm > _mc1.$@ && \
197-
$(PYTHON2) $(top_srcdir)/src/shaders/gpp.py _mc1.$@ $@ && \
197+
$(PYTHON3) $(top_srcdir)/src/shaders/gpp.py _mc1.$@ $@ && \
198198
rm _mc0.$@ _mc1.$@
199199

200200
$(INTEL_MC_G4B_GEN5): $(INTEL_MC_GEN5_ASM)

src/shaders/post_processing/gen5_6/Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,15 @@ if HAVE_GEN4ASM
200200
$(INTEL_PP_GEN5_ASM): $(INTEL_PP_ASM)
201201
.asm.g5s:
202202
$(AM_V_GEN)cpp -D DEV_ILK -I $(srcdir)/Common/ -I $(srcdir)/Core_Kernels $< > _pp0.$@; \
203-
$(PYTHON2) $(top_srcdir)/src/shaders/gpp.py _pp0.$@ $@; \
203+
$(PYTHON3) $(top_srcdir)/src/shaders/gpp.py _pp0.$@ $@; \
204204
rm _pp0.$@
205205
.g5s.g4b.gen5:
206206
$(AM_V_GEN)$(GEN4ASM) -a -o $@ -g 5 $<
207207

208208
$(INTEL_PP_GEN6_ASM): $(INTEL_PP_ASM)
209209
.asm.g6s:
210210
$(AM_V_GEN)cpp -D GT -I $(srcdir)/Common/ -I $(srcdir)/Core_Kernels $< > _pp0.$@; \
211-
$(PYTHON2) $(top_srcdir)/src/shaders/gpp.py _pp0.$@ $@; \
211+
$(PYTHON3) $(top_srcdir)/src/shaders/gpp.py _pp0.$@ $@; \
212212
rm _pp0.$@
213213
.g6s.g6b:
214214
$(AM_V_GEN)$(GEN4ASM) -a -o $@ -g 6 $<

src/shaders/post_processing/gen7/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ if HAVE_GEN4ASM
8686
$(INTEL_PP_GEN7_ASM): $(INTEL_PP_ASM) $(INTEL_PP_G4A)
8787
.asm.g7s:
8888
$(AM_V_GEN)cpp $< > _pp0.$@; \
89-
$(PYTHON2) $(top_srcdir)/src/shaders/gpp.py _pp0.$@ $@; \
89+
$(PYTHON3) $(top_srcdir)/src/shaders/gpp.py _pp0.$@ $@; \
9090
rm _pp0.$@
9191
.g7s.g7b:
9292
$(AM_V_GEN)$(GEN4ASM) -a -o $@ -g 7 $<

src/shaders/post_processing/gen8/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ if HAVE_GEN4ASM
6565
$(INTEL_PP_GEN8_ASM): $(INTEL_PP_ASM) $(INTEL_PP_G8A)
6666
.asm.g8s:
6767
$(AM_V_GEN)cpp $< > _pp0.$@; \
68-
$(PYTHON2) $(top_srcdir)/src/shaders/gpp.py _pp0.$@ $@; \
68+
$(PYTHON3) $(top_srcdir)/src/shaders/gpp.py _pp0.$@ $@; \
6969
rm _pp0.$@
7070
.g8s.g8b:
7171
$(AM_V_GEN)$(GEN4ASM) -a -o $@ -g 8 $<

src/shaders/post_processing/gen9/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if HAVE_GEN4ASM
6666
$(INTEL_PP_GEN9_ASM): $(INTEL_PP_ASM) $(INTEL_PP_G9A)
6767
.asm.g9s:
6868
$(AM_V_GEN)cpp $< > _pp0.$@; \
69-
$(PYTHON2) $(top_srcdir)/src/shaders/gpp.py _pp0.$@ $@; \
69+
$(PYTHON3) $(top_srcdir)/src/shaders/gpp.py _pp0.$@ $@; \
7070
rm _pp0.$@
7171
.g9s.g9b:
7272
$(AM_V_GEN)$(GEN4ASM) -a -o $@ -g 9 $<

0 commit comments

Comments
 (0)