summaryrefslogtreecommitdiffstats
path: root/clang/docs/conf.py
diff options
context:
space:
mode:
authorSerge Guelton <sguelton@quarkslab.com>2018-12-18 08:36:33 +0000
committerSerge Guelton <sguelton@quarkslab.com>2018-12-18 08:36:33 +0000
commitc0ebe773cd0fb301474430205c69440f9915d5b0 (patch)
tree15c98a08b79b0dddbfeea4f95372771ba44d4dd1 /clang/docs/conf.py
parent85833393d0e588f6d7613567db9c212236e3f0eb (diff)
downloadbcm5719-llvm-c0ebe773cd0fb301474430205c69440f9915d5b0.tar.gz
bcm5719-llvm-c0ebe773cd0fb301474430205c69440f9915d5b0.zip
Portable Python script across Python version
Using from __future__ import print_function it is possible to have a compatible behavior of `print(...)` across Python version. Differential Revision: https://reviews.llvm.org/D55213 llvm-svn: 349454
Diffstat (limited to 'clang/docs/conf.py')
-rw-r--r--clang/docs/conf.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/docs/conf.py b/clang/docs/conf.py
index dc69f8a848e..a18ce3a3042 100644
--- a/clang/docs/conf.py
+++ b/clang/docs/conf.py
@@ -11,6 +11,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
+from __future__ import print_function
import sys, os
from datetime import date
@@ -233,14 +234,14 @@ for name in os.listdir(command_guide_path):
header = f.readline().rstrip('\n')
if len(header) != len(title):
- print >>sys.stderr, (
+ print((
"error: invalid header in %r (does not match title)" % (
- file_subpath,))
+ file_subpath,)), file=sys.stderr)
if ' - ' not in title:
- print >>sys.stderr, (
+ print((
("error: invalid title in %r "
"(expected '<name> - <description>')") % (
- file_subpath,))
+ file_subpath,)), file=sys.stderr)
# Split the name out of the title.
name,description = title.split(' - ', 1)
OpenPOWER on IntegriCloud