[clang-tools-extra] r198204 - Make lit.site.cfg Py3-compatible. Copied from r188041.

Kim Gräsman kim.grasman at gmail.com
Mon Dec 30 06:09:25 PST 2013


On Mon, Dec 30, 2013 at 7:18 AM, NAKAMURA Takumi <geek4civic at gmail.com> wrote:
> Author: chapuni
> Date: Mon Dec 30 00:18:08 2013
> New Revision: 198204
>
> URL: http://llvm.org/viewvc/llvm-project?rev=198204&view=rev
> Log:
> Make lit.site.cfg Py3-compatible. Copied from r188041.
>
> Modified:
>     clang-tools-extra/trunk/test/lit.site.cfg.in
>
> Modified: clang-tools-extra/trunk/test/lit.site.cfg.in
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/lit.site.cfg.in?rev=198204&r1=198203&r2=198204&view=diff
> ==============================================================================
> --- clang-tools-extra/trunk/test/lit.site.cfg.in (original)
> +++ clang-tools-extra/trunk/test/lit.site.cfg.in Mon Dec 30 00:18:08 2013
> @@ -1,3 +1,5 @@
> +import sys
> +
>  ## Autogenerated by LLVM/Clang configuration.
>  # Do not edit!
>  config.llvm_src_root = "@LLVM_SOURCE_DIR@"
> @@ -14,7 +16,8 @@ config.have_libedit = "@HAVE_LIBEDIT@"
>  try:
>      config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
>      config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params
> -except KeyError,e:
> +except KeyError:
> +    e = sys.exc_info()[1]

What's the range of supported Python versions? Python 2.6 and later
supports 'as' instead of ',':

  try:
    ...
  except KeyError as e:
    ...

It's cleaner than unpacking exception info from sys.exc_info.

FWIW,
- Kim



More information about the cfe-commits mailing list