diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2017-12-22 20:51:46 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2017-12-22 20:51:46 (GMT) |
commit | c1b8eb8006ed79bbf91dc7d89918f39cc10b4fe6 (patch) | |
tree | 0736b8d7f637e6f4cf4c4d0c26fa0cfa04398d02 /Misc | |
parent | 2e1ef00171179a8b906631b175cde2e68a804522 (diff) | |
download | cpython-c1b8eb8006ed79bbf91dc7d89918f39cc10b4fe6.zip cpython-c1b8eb8006ed79bbf91dc7d89918f39cc10b4fe6.tar.gz cpython-c1b8eb8006ed79bbf91dc7d89918f39cc10b4fe6.tar.bz2 |
bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar files (GH-4977) (#4979)
This is more complicated than it should be because we need to preserve the
useful mtime-based regeneration feature that lib2to3.pgen2.driver.load_grammar
has. We only look for the pickled grammar file with pkgutil.get_data and only if
the source file does not exist.
(cherry picked from commit 8a5877165e993afb2633cd48da5222326d3f6e0e)
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Tools-Demos/2017-12-22-09-25-51.bpo-24960.TGdAgO.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Tools-Demos/2017-12-22-09-25-51.bpo-24960.TGdAgO.rst b/Misc/NEWS.d/next/Tools-Demos/2017-12-22-09-25-51.bpo-24960.TGdAgO.rst new file mode 100644 index 0000000..6f9d83c --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2017-12-22-09-25-51.bpo-24960.TGdAgO.rst @@ -0,0 +1,3 @@ +2to3 and lib2to3 can now read pickled grammar files using pkgutil.get_data() +rather than probing the filesystem. This lets 2to3 and lib2to3 work when run +from a zipfile. |