diff options
author | Michael Denkowski <mdenkows@cs.cmu.edu> | 2013-09-23 08:22:52 -0700 |
---|---|---|
committer | Michael Denkowski <mdenkows@cs.cmu.edu> | 2013-09-23 08:22:52 -0700 |
commit | e5a044b73f263d4be31b3ff87c8f14005f2e8562 (patch) | |
tree | c4c937a3b6c08a86f888620314d03af087636e70 /realtime | |
parent | 6efdb6758dc2d204d203bf3dcdb0ea14b6e2bbd5 (diff) | |
parent | 26505958e4ab2f865c2a838628af21ae4ad70e01 (diff) |
Merge branch 'master' of github.com:redpony/cdec
Diffstat (limited to 'realtime')
-rw-r--r-- | realtime/rt/rt.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/realtime/rt/rt.py b/realtime/rt/rt.py index b1cf19ef..033ed790 100644 --- a/realtime/rt/rt.py +++ b/realtime/rt/rt.py @@ -101,7 +101,8 @@ class RealtimeDecoder: logging.info('Grammar cache hit') return grammar_file # Extract and cache - grammar_file = tempfile.mkstemp(dir=self.tmp, prefix='grammar.')[1] + (fid, grammar_file) = tempfile.mkstemp(dir=self.tmp, prefix='grammar.') + os.close(fid) with open(grammar_file, 'w') as output: for rule in self.extractor.grammar(sentence): output.write('{}\n'.format(str(rule))) |