Mesa (master): util/gen_xmlpool: Use print function instad of sys.stderr.write
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Oct 31 23:39:23 UTC 2018
Module: Mesa
Branch: master
Commit: 187fad5c0b21f57a073cb797bfdf7eed961e9405
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=187fad5c0b21f57a073cb797bfdf7eed961e9405
Author: Dylan Baker <dylan at pnwbakers.com>
Date: Wed Oct 24 12:02:41 2018 -0700
util/gen_xmlpool: Use print function instad of sys.stderr.write
This ensures that stderr is flushed, unlike writing
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
---
src/util/xmlpool/gen_xmlpool.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/util/xmlpool/gen_xmlpool.py b/src/util/xmlpool/gen_xmlpool.py
index 70e0f96df9..9d932f3e85 100644
--- a/src/util/xmlpool/gen_xmlpool.py
+++ b/src/util/xmlpool/gen_xmlpool.py
@@ -170,7 +170,7 @@ for lang in args.languages:
with io.open(filename, 'rb') as f:
trans = gettext.GNUTranslations(f)
except (IOError, OSError):
- sys.stderr.write("Warning: language '%s' not found.\n" % lang)
+ print("Warning: language '%s' not found." % lang, file=sys.stderr)
continue
translations.append((lang, trans))
@@ -200,9 +200,8 @@ for line in template:
expandMatches(descMatches, translations, line)
descMatches = []
else:
- sys.stderr.write(
- "Warning: unexpected line inside description dropped:\n%s\n" \
- % line)
+ print("Warning: unexpected line inside description dropped:\n", line,
+ file=sys.stderr)
continue
if reLibintl_h.search(line):
# Ignore (comment out) #include <libintl.h>
@@ -227,5 +226,5 @@ for line in template:
template.close()
if len(descMatches) > 0:
- sys.stderr.write("Warning: unterminated description at end of file.\n")
+ print("Warning: unterminated description at end of file.", file=sys.stderr)
expandMatches(descMatches, translations)
More information about the mesa-commit
mailing list