Skip to content

Commit

Permalink
Fix output of hy2py on Python 3.
Browse files Browse the repository at this point in the history
Closes hylang#535.
  • Loading branch information
berkerpeksag committed Mar 18, 2014
1 parent fa69d80 commit 612d3ae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/hy2py
@@ -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
Expand All @@ -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))

0 comments on commit 612d3ae

Please sign in to comment.