summaryrefslogtreecommitdiff
path: root/ply/yacc.py
diff options
context:
space:
mode:
authorJoe Eagar <joeedh@gmail.com>2015-08-09 12:15:20 -0700
committerJoe Eagar <joeedh@gmail.com>2015-08-09 12:15:20 -0700
commitac0cacd80ff0e7a64d4d61892db6542c14dbade7 (patch)
treed09028df4bc5ad5e8b8faa3db1a637f21db2e7dc /ply/yacc.py
parentdbf122652d38ba03ff9f9fe4aa9bee3693e6775f (diff)
downloadply-ac0cacd80ff0e7a64d4d61892db6542c14dbade7.tar.gz
check for existence of pickled parse tables before
trying to read them.
Diffstat (limited to 'ply/yacc.py')
-rw-r--r--ply/yacc.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ply/yacc.py b/ply/yacc.py
index eb02cc2..32e3f85 100644
--- a/ply/yacc.py
+++ b/ply/yacc.py
@@ -1982,6 +1982,9 @@ class LRTable(object):
import cPickle as pickle
except ImportError:
import pickle
+
+ if not os.path.exists(filename):
+ raise ImportError
in_f = open(filename, 'rb')