[OpenSCAD] Avoid writing temporary parse cache file
Creating the parsetab.py cache file in a system wide fixed location (e.g. /tmp/parsetab.py) creates problems when a computer is used by different users. Also the file is never removed, which is not very nice. Caching provides hardly any benefit here, as it only takes milliseconds, and may even be negated by the additional required filesystem operations. Fixes (part of) #6315.
This commit is contained in:
committed by
Chris Hennes
parent
9fcf5faf69
commit
7cac8787a4
@@ -35,7 +35,6 @@ printverbose = False
|
||||
import FreeCAD
|
||||
import io
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
import ply.lex as lex
|
||||
import ply.yacc as yacc
|
||||
@@ -178,9 +177,9 @@ def processcsg(filename):
|
||||
|
||||
# Build the parser
|
||||
if printverbose: print('Load Parser')
|
||||
# No debug out otherwise Linux has protection exception
|
||||
temp = tempfile.gettempdir()
|
||||
parser = yacc.yacc(debug=False,outputdir=temp)
|
||||
# Disable generation of debug ('parser.out') and table cache ('parsetab.py'),
|
||||
# as it requires a writable location
|
||||
parser = yacc.yacc(debug=False, write_tables=False)
|
||||
if printverbose: print('Parser Loaded')
|
||||
# Give the lexer some input
|
||||
#f=open('test.scad', 'r')
|
||||
|
||||
Reference in New Issue
Block a user