Author twouters
Recipients benjamin.peterson, eric.araujo, ezio.melotti, kushal.das, loewis, python-dev, twouters, vstinner
Date 2014-04-16.21:06:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397682383.55.0.435369110345.issue17861@psf.upfronthosting.co.za>
In-reply-to
Content
FYI, this broke building in a separate object directory (again!) for multiple reasons: it's running the script without specifying $(srcdir), and it's writing to $(srcdir)/Include/opcode.h (where $(srcdir) may be unwritable), and it's picking up the wrong opcode module: the sys.path mucking in Tools/generate_opcode_h.py isn't inserting the right directory for 'import opcode' to pick up the target-Python's opcode.py. It should probably be using execfile() and have the name of the file passed in, instead.

Even if it were importing the right opcode.py, relying on 'import' or 'execfile' here sounds like a bad idea: it means the opcode module of the *target* Python needs to be compatible with the Python that the generate_opcode_h.py script runs with. Since the syntax of opcode.h is much more constrained, a more flexible approach, in my opinion, would be to parse opcode.h to produce opcode.py (or an _opcode.py with just the definitions, that opcode.py would then import.)
History
Date User Action Args
2014-04-16 21:06:23twouterssetrecipients: + twouters, loewis, vstinner, benjamin.peterson, ezio.melotti, eric.araujo, python-dev, kushal.das
2014-04-16 21:06:23twouterssetmessageid: <1397682383.55.0.435369110345.issue17861@psf.upfronthosting.co.za>
2014-04-16 21:06:23twouterslinkissue17861 messages
2014-04-16 21:06:23twouterscreate