summaryrefslogtreecommitdiffstats
path: root/clang/tools/scan-view/bin
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/tools/scan-view/bin
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/tools/scan-view/bin')
-rwxr-xr-xclang/tools/scan-view/bin/scan-view12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view
index 6e384ec2171..e3abb1c8347 100755
--- a/clang/tools/scan-view/bin/scan-view
+++ b/clang/tools/scan-view/bin/scan-view
@@ -1,5 +1,7 @@
#!/usr/bin/env python
+from __future__ import print_function
+
"""The clang static analyzer results viewer.
"""
@@ -52,10 +54,10 @@ def start_browser(port, options):
sys.stderr.flush()
time.sleep(kSleepTimeout)
else:
- print >> sys.stderr, 'WARNING: Unable to detect that server started.'
+ print('WARNING: Unable to detect that server started.', file=sys.stderr)
if options.debug:
- print >> sys.stderr, '%s: Starting webbrowser...' % sys.argv[0]
+ print('%s: Starting webbrowser...' % sys.argv[0], file=sys.stderr)
webbrowser.open(url)
@@ -69,9 +71,9 @@ def run(port, options, root):
import ScanView
try:
- print 'Starting scan-view at: http://%s:%d' % (options.host,
- port)
- print ' Use Ctrl-C to exit.'
+ print('Starting scan-view at: http://%s:%d' % (options.host,
+ port))
+ print(' Use Ctrl-C to exit.')
httpd = ScanView.create_server((options.host, port),
options, root)
httpd.serve_forever()
OpenPOWER on IntegriCloud