Thomas Wouters added the comment:

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.)

----------
nosy: +twouters

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17861>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to