summaryrefslogtreecommitdiffstats
path: root/clang/tools/scan-view
diff options
context:
space:
mode:
authorSerge Guelton <sguelton@quarkslab.com>2018-12-18 16:07:06 +0000
committerSerge Guelton <sguelton@quarkslab.com>2018-12-18 16:07:06 +0000
commit3ee1ffc9fcb09dcfbcb6b84e19c9855eae8cafa2 (patch)
tree9e0864952ca80b3edc28927252bd27545754aca4 /clang/tools/scan-view
parentae7ac3ca5b9598ba08e3d7fd7b071ceac4357c62 (diff)
downloadbcm5719-llvm-3ee1ffc9fcb09dcfbcb6b84e19c9855eae8cafa2.tar.gz
bcm5719-llvm-3ee1ffc9fcb09dcfbcb6b84e19c9855eae8cafa2.zip
Portable Python script across Python version
commands.getoutput has been move to subprocess module in Python3 Differential Revision: https://reviews.llvm.org/D55205 llvm-svn: 349503
Diffstat (limited to 'clang/tools/scan-view')
-rw-r--r--clang/tools/scan-view/share/startfile.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/tools/scan-view/share/startfile.py b/clang/tools/scan-view/share/startfile.py
index 58023d0271a..9eb548bc432 100644
--- a/clang/tools/scan-view/share/startfile.py
+++ b/clang/tools/scan-view/share/startfile.py
@@ -110,7 +110,10 @@ elif sys.platform == 'darwin':
# Platform support for Unix
else:
- import commands
+ try:
+ from commands import getoutput
+ except ImportError:
+ from subprocess import getoutput
# @WARNING: use the private API of the webbrowser module
from webbrowser import _iscommand
@@ -125,7 +128,7 @@ else:
def detect_kde_version(self):
kde_version = None
try:
- info = commands.getoutput('kde-config --version')
+ info = getoutput('kde-config --version')
for line in info.splitlines():
if line.startswith('KDE'):
@@ -158,7 +161,7 @@ else:
desktop_environment = 'gnome'
else:
try:
- info = commands.getoutput('xprop -root _DT_SAVE_MODE')
+ info = getoutput('xprop -root _DT_SAVE_MODE')
if ' = "xfce4"' in info:
desktop_environment = 'xfce'
except (OSError, RuntimeError):
OpenPOWER on IntegriCloud