Skip to content

Commit

Permalink
Merge pull request #2 from agermanidis/master
Browse files Browse the repository at this point in the history
remove the temporary file automatically on windows
  • Loading branch information
BingLingGroup authored Feb 12, 2019
2 parents 6e1c99c + d32389c commit e90c90c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autosub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ def __call__(self, region):
"-loglevel", "error", temp.name]
use_shell = True if os.name == "nt" else False
subprocess.check_output(command, stdin=open(os.devnull), shell=use_shell)
return temp.read()
read_data = temp.read()
temp.close()
os.unlink(temp.name)
return read_data

except KeyboardInterrupt:
return None
Expand Down

0 comments on commit e90c90c

Please sign in to comment.