Merge pull request #537 from berkerpeksag/issue-535
Fix output of hy2py on Python 3.
This commit is contained in:
commit
2fda9b0c79
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from __future__ import print_function
|
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 argparse
|
||||||
import sys
|
import sys
|
||||||
@ -25,15 +26,15 @@ options = parser.parse_args(sys.argv[1:])
|
|||||||
|
|
||||||
if options.with_source:
|
if options.with_source:
|
||||||
hst = import_file_to_hst(options.args[0])
|
hst = import_file_to_hst(options.args[0])
|
||||||
print(str(hst).encode("utf-8"))
|
print(hst)
|
||||||
print()
|
print()
|
||||||
print()
|
print()
|
||||||
|
|
||||||
_ast = import_file_to_ast(options.args[0], module_name)
|
_ast = import_file_to_ast(options.args[0], module_name)
|
||||||
if options.with_ast:
|
if options.with_ast:
|
||||||
print(astor.dump(_ast).encode("utf-8"))
|
print(astor.dump(_ast))
|
||||||
print()
|
print()
|
||||||
print()
|
print()
|
||||||
|
|
||||||
if not options.without_python:
|
if not options.without_python:
|
||||||
print(astor.codegen.to_source(_ast).encode("utf-8"))
|
print(astor.codegen.to_source(_ast))
|
||||||
|
Loading…
Reference in New Issue
Block a user