On 6/5/07, Ron Adam <[EMAIL PROTECTED]> wrote: > Alexandre Vassalotti wrote: > > On 6/5/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > >> If "make clean" makes the problem go away, it's usually because there > >> were old .pyc files with incompatible byte code. We don't change the > >> .pyc magic number for each change to the compiler. > > > > Nope. It is still not working. I just did the following, and I still > > get the same error. > > > > % make # run fine > > % make # fail > > I can confirm the same behavior. Works on the first make, same error on > the second. I deleted the contents of the branch and did an "svn up" on an > empty directory. Same thing.
This probably means there is a problem with marshalling the byte code out. The first run compiles the .pyc files. Theoretically this writes out the same thing in memory. This isn't always the case though (ie, when there are bugs). A work around would be to just remove the .pyc files each time rather than do a make clean. Do: find . -name '*.pyc' -print0 | xargs -0 rm Bonus points for finding the bug. :-) A quick way to test this is to try to roundrip it. Something like: >>> s = '''\ ... class F: ... def foo(self, *args): ... print(self, args) ... ''' >>> code = compile(s, 'foo', 'exec') >>> import marshal >>> marshal.loads(marshal.dumps(code)) == code True If it doesn't equal True, you found the problem. n _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
