mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-39313: Add an option to RefactoringTool for using exec as a function (GH-17967)
https://bugs.python.org/issue39313 Automerge-Triggered-By: @pablogsal
This commit is contained in:
parent
14dbe4b3f0
commit
61b14151cc
5 changed files with 23 additions and 8 deletions
|
@ -154,6 +154,8 @@ def main(fixer_pkg, args=None):
|
|||
help="List available transformations")
|
||||
parser.add_option("-p", "--print-function", action="store_true",
|
||||
help="Modify the grammar so that print() is a function")
|
||||
parser.add_option("-e", "--exec-function", action="store_true",
|
||||
help="Modify the grammar so that exec() is a function")
|
||||
parser.add_option("-v", "--verbose", action="store_true",
|
||||
help="More verbose logging")
|
||||
parser.add_option("--no-diffs", action="store_true",
|
||||
|
@ -211,6 +213,9 @@ def main(fixer_pkg, args=None):
|
|||
if options.print_function:
|
||||
flags["print_function"] = True
|
||||
|
||||
if options.exec_function:
|
||||
flags["exec_function"] = True
|
||||
|
||||
# Set up logging handler
|
||||
level = logging.DEBUG if options.verbose else logging.INFO
|
||||
logging.basicConfig(format='%(name)s: %(message)s', level=level)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue