Fix output of hy2py on Python 3.

Closes #535.
This commit is contained in:
Berker Peksag 2014-03-18 10:08:20 +02:00
parent fa69d80b8d
commit 612d3ae457

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python
from __future__ import print_function
from hy.importer import (import_file_to_ast, import_file_to_hst)
from hy.importer import import_file_to_ast, import_file_to_hst
import argparse
import sys
@ -25,15 +26,15 @@ options = parser.parse_args(sys.argv[1:])
if options.with_source:
hst = import_file_to_hst(options.args[0])
print(str(hst).encode("utf-8"))
print(hst)
print()
print()
_ast = import_file_to_ast(options.args[0], module_name)
if options.with_ast:
print(astor.dump(_ast).encode("utf-8"))
print(astor.dump(_ast))
print()
print()
if not options.without_python:
print(astor.codegen.to_source(_ast).encode("utf-8"))
print(astor.codegen.to_source(_ast))