summaryrefslogtreecommitdiffstats
path: root/clang/utils/check_cfc
diff options
context:
space:
mode:
authorSerge Guelton <sguelton@quarkslab.com>2018-12-18 08:25:25 +0000
committerSerge Guelton <sguelton@quarkslab.com>2018-12-18 08:25:25 +0000
commit73cf752f1b5a408b84bc3101d5e1cff1303e5d6a (patch)
treef3c52fc099c6a7fa6cbb00bad8ff89efe9d6d7c5 /clang/utils/check_cfc
parentc5d97e3e356632223fa07fced992ddcbb15abb5d (diff)
downloadbcm5719-llvm-73cf752f1b5a408b84bc3101d5e1cff1303e5d6a.tar.gz
bcm5719-llvm-73cf752f1b5a408b84bc3101d5e1cff1303e5d6a.zip
Portable Python script across Python version
ConfigParser module has been renamed as configparser in Python3 Differential Revision: https://reviews.llvm.org/D55200 llvm-svn: 349449
Diffstat (limited to 'clang/utils/check_cfc')
-rwxr-xr-xclang/utils/check_cfc/check_cfc.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/utils/check_cfc/check_cfc.py b/clang/utils/check_cfc/check_cfc.py
index 7a739f46e30..0228f1d6259 100755
--- a/clang/utils/check_cfc/check_cfc.py
+++ b/clang/utils/check_cfc/check_cfc.py
@@ -56,7 +56,10 @@ import shutil
import subprocess
import sys
import tempfile
-import ConfigParser
+try:
+ import configparser
+except ImportError:
+ import ConfigParser as configparser
import io
import obj_diff
@@ -318,7 +321,7 @@ if __name__ == '__main__':
for c in checks:
default_config += "{} = false\n".format(c)
- config = ConfigParser.RawConfigParser()
+ config = configparser.RawConfigParser()
config.readfp(io.BytesIO(default_config))
scriptdir = get_main_dir()
config_path = os.path.join(scriptdir, 'check_cfc.cfg')
OpenPOWER on IntegriCloud