mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 13:10:10 +01:00
pvr: csbgen: Isolate "main" function with __name__ check
Signed-off-by: Matt Coster <matt.coster@imgtec.com> Reviewed-by: Frank Binns <frank.binns@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16884>
This commit is contained in:
parent
a8b80c610b
commit
2285ddc720
1 changed files with 9 additions and 7 deletions
|
|
@ -31,7 +31,6 @@ from __future__ import annotations
|
|||
|
||||
import copy
|
||||
import os
|
||||
import sys
|
||||
import textwrap
|
||||
import typing as t
|
||||
import xml.parsers.expat as expat
|
||||
|
|
@ -966,11 +965,14 @@ class Parser:
|
|||
file.close()
|
||||
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("No input xml file specified")
|
||||
sys.exit(1)
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
input_file = sys.argv[1]
|
||||
if len(sys.argv) < 2:
|
||||
print("No input xml file specified")
|
||||
sys.exit(1)
|
||||
|
||||
p = Parser()
|
||||
p.parse(input_file)
|
||||
input_file = sys.argv[1]
|
||||
|
||||
p = Parser()
|
||||
p.parse(input_file)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue