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 | f8a0d65a4cebd45bd48ccf9b4df0cfbab4ab643e (patch) | |
tree | 95ffc61964447c15a79d6a9ee76232c3a55b4863 | |
parent | ae3cfd5700d20d30a06f5c27ea1c5e39a458c783 (diff) | |
parent | 903339fdd7c294a72a8b2066550dbb5dd78f5384 (diff) |
Merge branch 'master' of github.com:redpony/cdec
-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))) |