[New-bugs-announce] [issue15964] SyntaxError in asdl when building 2.7 with system Python 3

Chris Jerdonek report at bugs.python.org
Tue Sep 18 16:26:19 CEST 2012


New submission from Chris Jerdonek:

Building with--

./configure --with-pydebug && make -j2

errors out after switching branches from default to 2.7 when the system Python is Python 3 (on Mac OS X 10.7.4 using MacPorts).

To reproduce:

$ sudo port select python python32
$ python
No such file or directory
$ python3 -V
Python 3.2.3
$ hg update default
$ ./configure --with-pydebug && make -j2
$ hg update 2.7
$ cp Modules/Setup.dist Modules/Setup
$ ./configure --with-pydebug && make -j2
...
config.status: creating pyconfig.h
config.status: pyconfig.h is unchanged
creating Modules/Setup
creating Modules/Setup.local
creating Makefile
./install-sh -c -d Include
./Parser/asdl_c.py -h Include ./Parser/Python.asdl
gcc -c -fno-strict-aliasing -g -O2 -g -O0 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Parser/printgrammar.o Parser/printgrammar.c
gcc -c -fno-strict-aliasing -g -O2 -g -O0 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Parser/pgenmain.o Parser/pgenmain.c
  File "./Parser/asdl_c.py", line 1
    print "Must specify exactly one output file"
                                               ^
SyntaxError: invalid syntax
make: *** [Include/Python-ast.h] Error 1
make: *** Waiting for unfinished jobs....

Running "make distclean" doesn't fix this.  Here is one work-around:

$ sudo port select python python27
$ ./configure --with-pydebug && make -j2

Perhaps the right work-around can be documented in the devguide, or maybe this can be addressed another way.

----------
components: Build
messages: 170646
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: SyntaxError in asdl when building 2.7 with system Python 3
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15964>
_______________________________________


More information about the New-bugs-announce mailing list