Message4958
AST node creation does not work in Jython in the same way as it does in
CPython.
Example:
try:
#it's ast in Python 2.6
import ast
except ImportError:
#it's _ast in Python 2.5
import _ast
old_ast = 1
def astnode_genAssign( targets, value):
if ( old_ast ):
tmp = _ast.Assign()
tmp.targets = targets
tmp.value = value
tmp.lineno = 0
return tmp
else:
tmp = ast.Assign( )
tmp.targets = targets
tmp.value = value
tmp.lineno = 0
return tmp
A call to astnode_genAssign works in Python2.5 and Python2.6, but in
Jython 2.5 it produces:
tmp = ast.Assign( )
TypeError: Assign() takes 2-4 arguments (0 given) |
|
Date |
User |
Action |
Args |
2009-07-28 23:11:16 | kellrott | set | recipients:
+ kellrott |
2009-07-28 23:11:16 | kellrott | set | messageid: <1248822676.8.0.409794783989.issue1415@psf.upfronthosting.co.za> |
2009-07-28 23:11:16 | kellrott | link | issue1415 messages |
2009-07-28 23:11:16 | kellrott | create | |
|