Commit d5ca149d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

write yacc parsed file to TMPDIR.

parent d0ae2120
......@@ -37,7 +37,8 @@ except ImportError:
def LOG(channel, level, message):
print >>sys.stderr, message
module_path = os.path.dirname(os.path.abspath(__file__))
outputdir = os.environ.get('TMPDIR', None) or \
os.path.dirname(os.path.abspath(__file__))
class ParserOrLexerError(Exception):
pass
......@@ -57,7 +58,7 @@ class lexer(object):
self.parser = yacc.yacc(module=self, debug=debug,
debugfile="%s.out" % (self.__class__.__name__, ),
tabmodule="%s_parsetab" % (self.__class__.__name__, ),
outputdir=module_path)
outputdir=outputdir)
sys.stdout, sys.stderr = sys.__stdout__, sys.__stderr__
# Emit all logs with regular Zope logging
for line in output.getvalue().split('\n'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment