mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-26 11:25:27 +00:00
Portable Python script across Python version
Make scripts more future-proof by importing most __future__ stuff. Differential Revision: https://reviews.llvm.org/D55208 llvm-svn: 349504
This commit is contained in:
parent
3ee1ffc9fc
commit
b748c0e696
@ -44,7 +44,7 @@ The major indexing objects are:
|
||||
Most object information is exposed using properties, when the underlying API
|
||||
call is efficient.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
# TODO
|
||||
# ====
|
||||
|
@ -11,7 +11,7 @@
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import sys, os
|
||||
from datetime import date
|
||||
|
||||
|
@ -21,7 +21,7 @@ Example usage for git/svn users:
|
||||
svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i
|
||||
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
import argparse
|
||||
import difflib
|
||||
|
@ -12,7 +12,7 @@
|
||||
# It operates on the current, potentially unsaved buffer and does not create
|
||||
# or save any files. To revert a formatting, just undo.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import sublime
|
||||
import sublime_plugin
|
||||
import subprocess
|
||||
|
@ -25,7 +25,7 @@
|
||||
#
|
||||
# It operates on the current, potentially unsaved buffer and does not create
|
||||
# or save any files. To revert a formatting, just undo.
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
import difflib
|
||||
import json
|
||||
|
@ -23,7 +23,7 @@ git clang-format -h
|
||||
Requires Python 2.7 or Python 3
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import argparse
|
||||
import collections
|
||||
import contextlib
|
||||
|
@ -22,7 +22,7 @@ you would like to rename and press '<leader>cr'. You will be prompted for a new
|
||||
name if the cursor points to a valid symbol.
|
||||
'''
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import vim
|
||||
import subprocess
|
||||
import sys
|
||||
|
@ -12,7 +12,7 @@ earlier.)
|
||||
It also implements basic validation methods, related to the command.
|
||||
Validations are mostly calling specific help methods, or mangling values.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
from pprint import pprint
|
||||
import random, atexit, time
|
||||
from random import randrange
|
||||
|
@ -1,6 +1,6 @@
|
||||
"""Utilities for enumeration of finite and countably infinite sets.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
###
|
||||
# Countable iteration
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import sys
|
||||
from socket import *
|
||||
from time import strftime
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
def pcall(f, N):
|
||||
if N == 0:
|
||||
print(' f(0)', file=f)
|
||||
|
@ -42,7 +42,7 @@ the Repository Directory.
|
||||
diff -ur CachedSource PatchedSource \
|
||||
> changes_for_analyzer.patch
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import SATestBuild
|
||||
|
||||
import os
|
||||
|
@ -3,7 +3,7 @@
|
||||
"""
|
||||
Update reference results for static analyzer.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
import SATestBuild
|
||||
|
||||
|
@ -6,7 +6,7 @@ Script to Summarize statistics in the scan-build output.
|
||||
Statistics are enabled by passing '-internal-stats' option to scan-build
|
||||
(or '-analyzer-stats' to the analyzer).
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
import sys
|
||||
|
||||
|
@ -47,7 +47,7 @@ To add a new check:
|
||||
subclass.
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
import imp
|
||||
import os
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python2.7
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
import argparse
|
||||
import difflib
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""For use on Windows. Run with:
|
||||
python.exe setup.py py2exe
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
from distutils.core import setup
|
||||
try:
|
||||
import py2exe
|
||||
|
@ -9,7 +9,7 @@
|
||||
# (lldb) command script import /path/to/clandiag.py
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import lldb
|
||||
import argparse
|
||||
import shlex
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
import json
|
||||
import optparse
|
||||
|
@ -4,7 +4,7 @@
|
||||
# 1) Update the 'decls' list below with your fuzzing configuration.
|
||||
# 2) Run with the clang binary as the command-line argument.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import random
|
||||
import subprocess
|
||||
import sys
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
#===------------------------------------------------------------------------===#
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
Loading…
x
Reference in New Issue
Block a user