cpython: adc5e6aca251 (original) (raw)
Mercurial > cpython
changeset 78895:adc5e6aca251 3.2
Issue #15822: Fix installation of lib2to3 grammar pickles to ensure they are created in the install locations and with the proper timestamp. (Solution suggested by MvL) [#15822]
Ned Deily nad@acm.org | |
---|---|
date | Sat, 08 Sep 2012 18:50:56 -0700 |
parents | 8c60bb098eff |
children | 23118b802f83 27d410dd5431 |
files | Lib/lib2to3/pgen2/driver.py Makefile.pre.in Misc/NEWS |
diffstat | 3 files changed, 23 insertions(+), 4 deletions(-)[+] [-] Lib/lib2to3/pgen2/driver.py 17 Makefile.pre.in 8 Misc/NEWS 2 |
line wrap: on
line diff
--- a/Lib/lib2to3/pgen2/driver.py +++ b/Lib/lib2to3/pgen2/driver.py @@ -138,3 +138,20 @@ def _newer(a, b): if not os.path.exists(b): return True return os.path.getmtime(a) >= os.path.getmtime(b) + + +def main(*args):
- Calls load_grammar for each argument, a path to a grammar text file.
- """
- if not args:
args = sys.argv[1:][](#l1.15)
- logging.basicConfig(level=logging.INFO, stream=sys.stdout,
format='%(message)s')[](#l1.17)
- for gt in args:
load_grammar(gt, save=True, force=True)[](#l1.19)
- return True
--- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -945,8 +945,6 @@ LIBSUBDIRS= tkinter tkinter/test tkinter unittest unittest/test [](#l2.4) curses pydoc_data $(MACHDEPS) libinstall: build_all (srcdir)/Lib/(srcdir)/Lib/(srcdir)/Lib/(PLATDIR) $(srcdir)/Modules/xxmodule.c - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) [](#l2.7) - ./$(BUILDPYTHON) -Wi -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" @for i in (SCRIPTDIR)(SCRIPTDIR) (SCRIPTDIR)(LIBDEST); [](#l2.9) do [](#l2.10) if test ! -d (DESTDIR)(DESTDIR)(DESTDIR)$i; then [](#l2.11) @@ -1024,6 +1022,10 @@ libinstall: build_all (srcdir)/Lib/(srcdir)/Lib/(srcdir)/Lib/(PL ./$(BUILDPYTHON) -Wi -O (DESTDIR)(DESTDIR)(DESTDIR)(LIBDEST)/compileall.py [](#l2.13) -d $(LIBDEST)/site-packages -f [](#l2.14) -x badsyntax (DESTDIR)(DESTDIR)(DESTDIR)(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) [](#l2.16) + ./$(BUILDPYTHON) -m lib2to3.pgen2.driver (DESTDIR)(DESTDIR)(DESTDIR)(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) [](#l2.18) + ./$(BUILDPYTHON) -m lib2to3.pgen2.driver (DESTDIR)(DESTDIR)(DESTDIR)(LIBDEST)/lib2to3/PatternGrammar.txt
Create the PLATDIR source directory, if one wasn't distributed..
(srcdir)/Lib/(srcdir)/Lib/(srcdir)/Lib/(PLATDIR): @@ -1264,7 +1266,7 @@ clean: pycremoval find . -name '.so.[0-9].[0-9]*' -exec rm -f {} ';' find build -name 'fficonfig.h' -exec rm -f {} ';' || true find build -name 'fficonfig.py' -exec rm -f {} ';' || true - -rm -f $(srcdir)/Lib/lib2to3/Grammar.pickle + -rm -f Lib/lib2to3/Grammar.pickle -rm -f Modules/_testembed profile-removal:
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -525,7 +525,7 @@ Build
- Issue #15819: Make sure we can build Python out-of-tree from a readonly source directory. (Somewhat related to Issue #9860.) -- Issue #15645: Ensure 2to3 grammar pickles are properly installed. +- Issue #15822: Ensure 2to3 grammar pickles are properly installed.
- Issue #15560: Fix building _sqlite3 extension on OS X with an SDK.