Skip to content

Commit e90c90c

Browse files
Merge pull request BingLingGroup#2 from agermanidis/master
remove the temporary file automatically on windows
2 parents 6e1c99c + d32389c commit e90c90c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

autosub/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ def __call__(self, region):
7171
"-loglevel", "error", temp.name]
7272
use_shell = True if os.name == "nt" else False
7373
subprocess.check_output(command, stdin=open(os.devnull), shell=use_shell)
74-
return temp.read()
74+
read_data = temp.read()
75+
temp.close()
76+
os.unlink(temp.name)
77+
return read_data
7578

7679
except KeyboardInterrupt:
7780
return None

0 commit comments

Comments
 (0)