diff --git a/test/Unit/lit.site.cfg.in b/test/Unit/lit.site.cfg.in index 65e98d0af55..c6e12400d1b 100644 --- a/test/Unit/lit.site.cfg.in +++ b/test/Unit/lit.site.cfg.in @@ -1,3 +1,5 @@ +import sys + ## Autogenerated by LLVM/Clang configuration. # Do not edit! config.llvm_src_root = "@LLVM_SOURCE_DIR@" @@ -13,7 +15,8 @@ config.shlibpath_var = "@SHLIBPATH_VAR@" try: config.llvm_tools_dir = config.llvm_tools_dir % lit.params config.llvm_build_mode = config.llvm_build_mode % lit.params -except KeyError,e: +except KeyError: + e = sys.exc_info()[1] key, = e.args lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in index 1ae99eb0249..3e7dc5c6a38 100644 --- a/test/lit.site.cfg.in +++ b/test/lit.site.cfg.in @@ -1,3 +1,5 @@ +import sys + ## Autogenerated by LLVM/Clang configuration. # Do not edit! config.host_triple = "@LLVM_HOST_TRIPLE@" @@ -25,7 +27,8 @@ config.have_zlib = "@HAVE_LIBZ@" # used when we can't determine the tool dir at configuration time. try: config.llvm_tools_dir = config.llvm_tools_dir % lit.params -except KeyError,e: +except KeyError: + e = sys.exc_info()[1] key, = e.args lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))