diff options
author | Serge Guelton <sguelton@quarkslab.com> | 2018-12-18 08:25:25 +0000 |
---|---|---|
committer | Serge Guelton <sguelton@quarkslab.com> | 2018-12-18 08:25:25 +0000 |
commit | 7f12885bea75c6242ba20076979031f0eb15ac60 (patch) | |
tree | 625441c5b25a376bc140ba9ac67af21cf619e0c7 /utils | |
parent | 3241c3649e96c7aaf63db8093035208dab3b7e13 (diff) |
Portable Python script across Python version
ConfigParser module has been renamed as configparser in Python3
Differential Revision: https://reviews.llvm.org/D55200
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349449 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/check_cfc/check_cfc.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/check_cfc/check_cfc.py b/utils/check_cfc/check_cfc.py index 7a739f46e3..0228f1d625 100755 --- a/utils/check_cfc/check_cfc.py +++ b/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') |