tags 484360 + patch thanks The interface to compiler.ast.From seems to have changed in Python 2.5. It now takes a required "level" argument. I believe passing it a value of 0 results in the same behavior as the old version. Anyway, this seems to work for destar (after I fix an unrelated bug in that package that I'm about to file...).
I've attached a patch that implements this. -- John Wright <[EMAIL PROTECTED]>
diff -u quixote1-1.2/ptl_compile.py quixote1-1.2/ptl_compile.py --- quixote1-1.2/ptl_compile.py +++ quixote1-1.2/ptl_compile.py @@ -55,8 +55,14 @@ # beginning of the module. doc = None # self.get_docstring(nodelist, symbol.file_input) - io_imp = ast.From(IO_MODULE, [(IO_CLASS, None)]) - markup_imp = ast.From(MARKUP_MODULE, [(MARKUP_CLASS, None)]) + try: + io_imp = ast.From(IO_MODULE, [(IO_CLASS, None)]) + markup_imp = ast.From(MARKUP_MODULE, [(MARKUP_CLASS, None)]) + except TypeError: + # Python 2.5+ has a slightly different API for From + io_imp = ast.From(IO_MODULE, [(IO_CLASS, None)], 0) + markup_imp = ast.From(MARKUP_MODULE, [(MARKUP_CLASS, None)], 0) + markup_assign = ast.Assign([ast.AssName(MARKUP_MANGLED_CLASS, OP_ASSIGN)], ast.Name(MARKUP_CLASS))