Skip to content

Commit

Permalink
fix attributeerror
Browse files Browse the repository at this point in the history
  • Loading branch information
TabulateJarl8 committed Jul 14, 2021
1 parent 90c3f3f commit e2bfac6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ti842py/__version__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__title__ = "ti842py"
__description__ = "TI-BASIC to Python 3 Transpiler"
__url__ = "https://github.com/TabulateJarl8/ti842py"
__version__ = "0.8.0"
__version__ = "0.8.1"
__author__ = "Tabulate"
__author_email__ = "[email protected]"
__license__ = "GPLv3"
Expand Down
17 changes: 9 additions & 8 deletions ti842py/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ def isUTF8(file):
def transpile(infile, outfile="stdout", decompileFile=True, forceDecompile=False, multiplication=True, floating_point=True, turbo_draw=False, run=False):

# detect stdin
if not os.path.exists(infile.name):
# Don't auto close since we are shadowing infile
temp_stdin = tempfile.NamedTemporaryFile()
temp_stdin.write(infile.buffer.read())
temp_stdin.seek(0)
infile = temp_stdin.name
else:
infile = infile.name
if hasattr(infile, 'name'):
if not os.path.exists(infile.name):
# Don't auto close since we are shadowing infile
temp_stdin = tempfile.NamedTemporaryFile()
temp_stdin.write(infile.buffer.read())
temp_stdin.seek(0)
infile = temp_stdin.name
else:
infile = infile.name

decode = not isUTF8(infile) and decompileFile is True

Expand Down

0 comments on commit e2bfac6

Please sign in to comment.