[all-commits] [llvm/llvm-project] 43d9f2: [opt viewer] Python compat - decode/encode string

Yuanfang Chen via All-commits all-commits at lists.llvm.org
Wed Jan 29 14:49:57 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 43d9f2d1e8ae2765c1fc02b7cf757c9c05761ac0
      https://github.com/llvm/llvm-project/commit/43d9f2d1e8ae2765c1fc02b7cf757c9c05761ac0
  Author: Yuanfang Chen <yuanfang.chen at sony.com>
  Date:   2020-01-29 (Wed, 29 Jan 2020)

  Changed paths:
    M llvm/tools/opt-viewer/opt-viewer.py
    M llvm/tools/opt-viewer/optrecord.py

  Log Message:
  -----------
  [opt viewer] Python compat - decode/encode string

Summary:
Use io.open instead of codecs.open according to here
https://stackoverflow.com/questions/10971033/backporting-python-3-openencoding-utf-8-to-python-2

Add `u` prefix to string literal to make them utf-8 in python2.

Reviewers: anemet, serge-sans-paille

Reviewed by: serge-sans-paille

Differential Revision: https://reviews.llvm.org/D73011




More information about the All-commits mailing list