Skip to content

Commit

Permalink
Python3 -c 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowone committed Apr 5, 2024
1 parent 5b77e55 commit fcc05ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion aheui/aheui.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ def prepare_compiler(contents, opt_level=2, source='code', aheuic_output=None, a
elif source == 'asm':
compiler.read_asm(contents.decode('utf-8'))
else:
compiler.compile(contents.decode('utf-8'), add_debug_info=add_debug_info)
contents = contents.decode('utf-8')
compiler.compile(contents, add_debug_info=add_debug_info)

if opt_level == 0:
pass
Expand Down
6 changes: 4 additions & 2 deletions aheui/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import os
from aheui._argparse import ArgumentParser
from aheui._compat import bigint
from aheui._compat import bigint, PY3
from aheui.version import VERSION
from aheui import compile

Expand Down Expand Up @@ -89,6 +89,8 @@ def open_r(filename):
if len(args) != 1:
os.write(2, b'aheui: error: --cmd,-c but input file found\n')
raise SystemExit()
if PY3:
cmd = cmd.encode('utf-8')
contents = cmd
filename = '-'

Expand All @@ -100,7 +102,7 @@ def open_r(filename):
source = 'bytecode'
elif filename.endswith('.aheuis'):
source = 'asm'
elif '\xff\xff\xff\xff' in contents:
elif b'\xff\xff\xff\xff' in contents:
source = 'bytecode'
else:
source = 'text'
Expand Down

0 comments on commit fcc05ad

Please sign in to comment.