Replace call to deprecated astor.codegen to astor.code_gen

PiperOrigin-RevId: 236706540
This commit is contained in:
A. Unique TensorFlower 2019-03-04 12:49:04 -08:00 committed by TensorFlower Gardener
parent 29c4c0f9ae
commit 6d580992f6

View File

@ -46,8 +46,8 @@ def ast_to_source(node, indentation=' '):
""" """
if not isinstance(node, (list, tuple)): if not isinstance(node, (list, tuple)):
node = (node,) node = (node,)
generator = astor.codegen.SourceGenerator(indentation, False, generator = astor.code_gen.SourceGenerator(indentation, False,
astor.string_repr.pretty_string) astor.string_repr.pretty_string)
for n in node: for n in node:
if isinstance(n, gast.AST): if isinstance(n, gast.AST):