llvm.org GIT mirror llvm / 51d5be3
[opt-viewer] Use Python 3-compatible `intern()` Summary: In Python 2, `intern()` is a builtin function available to all programs. In Python 3, it was moved into the `sys` module, available as `sys.intern`. Import it such that, within `optrecord.py`, `intern()` is available whether run using Python 2 or 3. Test Plan: Run `opt-viewer.py` using Python 3, confirm it no longer encounters a runtime error when `intern()` is called. Reviewers: anemet Reviewed By: anemet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36622 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310739 91177308-0d34-0410-b5e6-96231b3b80d8 Brian Gesiak 2 years ago
1 changed file(s) with 6 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
1616 from multiprocessing import Lock
1717 import os, os.path
1818 import subprocess
19 try:
20 # The previously builtin function `intern()` was moved
21 # to the `sys` module in Python 3.
22 from sys import intern
23 except:
24 pass
1925
2026 import optpmap
2127