Module Expr Str Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias alias Import alias Import alias Import alias Import alias ImportFrom alias alias Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad Assign NameStore ListLoad FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If Call NameLoad GeneratorExp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad body Assign NameStore NameLoad orelse If BoolOpAnd CompareIsNot NameLoad NameLoad Call NameLoad GeneratorExp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad body Assign NameStore NameLoad If UnaryOpNot NameLoad body Return NameLoad Assign NameStore Call AttributeLoad Str attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If BoolOpOr UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad CompareGt AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr body TryExcept body With Call NameLoad NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Call NameLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num If BoolOpAnd CompareNotEq NameLoad NameLoad CompareIs AttributeLoad NameLoad attr NameLoad body Return NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Assign NameStore NameLoad orelse Assign NameStore ListLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr TryExcept body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler type NameLoad body Return NameLoad If BoolOpAnd NameLoad CompareEq SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad keyword NameLoad If CompareNotEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Assign NameStore NameLoad Assign NameStore Call NameLoad NameLoad Str Return Call NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For NameStore AttributeLoad NameLoad attr body If CompareIs SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call NameLoad NameLoad FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr GeneratorExp Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad comprehension NameStore AttributeLoad NameLoad attr If BoolOpAnd UnaryOpNot NameLoad UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Slice Num NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Str keyword NameLoad orelse If NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num With Call NameLoad NameLoad NameStore body Assign NameStore Call NameLoad keyword Str keyword SubscriptLoad NameLoad Index Num Exec Call AttributeLoad NameLoad attr NameLoad orelse Import alias Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A Wrapper to run 2to3 automatically at import time.

Usage:
  auto2to3 -m mypackage.main_module
  auto2to3 mypackage/script.py

By default, all modules imported from a subdirectory of the current
directory will be run through `2to3`.  To change this behavior, use the
`--package` or `--dir` flags to `auto2to3` to specify which packages or
directories contain Python 2 code that should be converted.

2to3 output is cached on disk between runs for speed.

Based on auto2to3.py by Georg Brandl:
http://dev.pocoo.org/hg/sandbox/file/tip/auto2to3.py
 N/A argparse N/A os N/A sys N/A imp N/A runpy io StringIO pkgutil ImpImporter ImpLoader N/A runpy N/A sys N/A tempfile N/A lib2to3 lib2to3.refactor RefactoringTool get_fixers_from_package N/A fixes N/A get_fixers_from_package lib2to3.fixes N/A rt N/A RefactoringTool fixes N/A PACKAGES N/A N/A DIRS N/A maybe_2to3 N/A N/A filename modname N/A None N/A N/A Returns a python3 version of filename. N/A need_2to3 False N/A filename N/A N/A N/A os path abspath filename N/A N/A any N/A N/A N/A filename startswith d N/A d DIRS N/A N/A need_2to3 True N/A N/A N/A N/A modname None N/A any N/A N/A N/A modname startswith p N/A p PACKAGES N/A N/A need_2to3 True N/A N/A need_2to3 N/A N/A filename N/A outfilename N/A N/A /_auto2to3_ join N/A N/A N/A os path split filename N/A N/A N/A N/A N/A N/A os path exists outfilename N/A N/A N/A N/A os stat filename st_mtime N/A N/A N/A os stat outfilename st_mtime N/A N/A N/A N/A N/A open filename file N/A N/A contents N/A N/A file read N/A contents N/A N/A rt refactor_docstring contents filename N/A tree N/A N/A rt refactor_string contents filename N/A N/A N/A Exception N/A err N/A N/A N/A ImportError N/A 2to3 couldn't convert %r filename N/A outfile N/A open outfilename wb N/A N/A N/A outfile write N/A N/A N/A str tree encode utf8 N/A N/A N/A outfile close N/A outfilename N/A ToThreeImporter N/A ImpImporter N/A find_module N/A N/A self fullname path N/A None N/A N/A subname N/A N/A N/A fullname split . N/A -1 N/A N/A N/A subname fullname N/A N/A self path None N/A N/A None N/A N/A N/A self path None N/A N/A path None N/A N/A path N/A N/A N/A N/A os path realpath N/A self path N/A N/A N/A N/A file filename etc N/A N/A imp find_module subname path N/A N/A N/A ImportError N/A N/A None N/A N/A file N/A N/A etc N/A 2 N/A imp PY_SOURCE N/A N/A outfilename N/A maybe_2to3 filename modname fullname N/A N/A outfilename filename N/A N/A N/A N/A file close N/A filename outfilename N/A file N/A open filename rb N/A N/A ImpLoader fullname file filename etc N/A N/A N/A N/A N/A N/A sys path_hooks append ToThreeImporter N/A key N/A sys path_importer_cache N/A N/A N/A N/A N/A sys path_importer_cache N/A key None N/A N/A N/A N/A sys path_importer_cache N/A key N/A ToThreeImporter key main N/A N/A N/A N/A N/A parser N/A N/A argparse ArgumentParser N/A N/A N/A parser add_argument --package action append N/A N/A N/A parser add_argument --dir action append N/A N/A N/A parser add_argument -m action store metavar MODULE N/A N/A args rest N/A N/A parser parse_known_args N/A N/A args package N/A N/A N/A N/A PACKAGES extend N/A args package N/A N/A args dir N/A N/A N/A N/A DIRS extend N/A N/A N/A N/A os path abspath d N/A d N/A args dir N/A N/A N/A PACKAGES N/A DIRS N/A N/A N/A N/A DIRS append N/A N/A os getcwd N/A N/A args m N/A N/A N/A N/A sys argv N/A 1 rest N/A N/A N/A runpy run_module N/A args m run_name __main__ alter_sys True N/A N/A rest N/A N/A N/A sys argv rest N/A converted N/A maybe_2to3 N/A rest N/A 0 N/A N/A open converted f N/A N/A new_globals N/A dict __name__ __main__ __file__ N/A rest N/A 0 N/A N/A N/A f read new_globals N/A N/A code N/A N/A N/A code interact N/A N/A N/A __name__ __main__ N/A N/A N/A main