mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-13 17:50:31 +01:00
python: Use open(), not file()
The latter is a constructor for file objects, but when actually opening a file, using the former is more idiomatic. In addition, file() is not a builtin any more in Python 3, so this makes the script compatible with both Python 2 and Python 3. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
This commit is contained in:
parent
c24d826968
commit
8678fe537a
1 changed files with 3 additions and 1 deletions
|
|
@ -168,7 +168,7 @@ print("/***********************************************************************\
|
|||
|
||||
# Process the options template and generate options.h with all
|
||||
# translations.
|
||||
template = file (template_header_path, "r")
|
||||
template = open (template_header_path, "r")
|
||||
descMatches = []
|
||||
for line in template:
|
||||
if len(descMatches) > 0:
|
||||
|
|
@ -199,6 +199,8 @@ for line in template:
|
|||
else:
|
||||
print(line, end='')
|
||||
|
||||
template.close()
|
||||
|
||||
if len(descMatches) > 0:
|
||||
sys.stderr.write ("Warning: unterminated description at end of file.\n")
|
||||
expandMatches (descMatches, translations)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue