Commit 1f43e089 authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 0.7.2

parent 49944154
Metadata-Version: 1.0
Name: rply
Version: 0.7.1
Version: 0.7.2
Summary: A pure Python Lex/Yacc that works with RPython
Home-page: UNKNOWN
Author: Alex Gaynor
......
Metadata-Version: 1.0
Name: rply
Version: 0.7.1
Version: 0.7.2
Summary: A pure Python Lex/Yacc that works with RPython
Home-page: UNKNOWN
Author: Alex Gaynor
......
......@@ -123,18 +123,27 @@ class ParserGenerator(object):
g.compute_first()
g.compute_follow()
cache_file = os.path.join(
tempfile.gettempdir(),
"rply-%s-%s-%s-%s.json" % (self.VERSION, os.getuid(), self.cache_id, self.compute_grammar_hash(g))
)
# win32 temp directories are already per-user
if os.name == "nt":
cache_file = os.path.join(
tempfile.gettempdir(),
"rply-%s-%s-%s.json" % (self.VERSION, self.cache_id, self.compute_grammar_hash(g))
)
else:
cache_file = os.path.join(
tempfile.gettempdir(),
"rply-%s-%s-%s-%s.json" % (self.VERSION, os.getuid(), self.cache_id, self.compute_grammar_hash(g))
)
table = None
if os.path.exists(cache_file):
with open(cache_file) as f:
data = json.load(f)
stat_result = os.fstat(f.fileno())
if (
stat_result.st_uid == os.getuid() and
stat.S_IMODE(stat_result.st_mode) == 0o0600
os.name == "nt" or (
stat_result.st_uid == os.getuid() and
stat.S_IMODE(stat_result.st_mode) == 0o0600
)
):
if self.data_is_valid(g, data):
table = LRTable.from_cache(g, data)
......
......@@ -8,7 +8,7 @@ setup(
name="rply",
description="A pure Python Lex/Yacc that works with RPython",
long_description=readme,
version="0.7.1",
version="0.7.2",
author="Alex Gaynor",
author_email="alex.gaynor@gmail.com",
packages=["rply"],
......
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