[issue4067] ast.fix_missing_locations() breaks if node doesn't have "_attributes" variable

2008-10-19 Thread Armin Ronacher
Changes by Armin Ronacher <[EMAIL PROTECTED]>: -- resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue4067] ast.fix_missing_locations() breaks if node doesn't have "_attributes" variable

2008-10-19 Thread Armin Ronacher
Armin Ronacher <[EMAIL PROTECTED]> added the comment: Fixed in changeset 66973 for trunk. ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-b

[issue4067] ast.fix_missing_locations() breaks if node doesn't have "_attributes" variable

2008-10-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: empty_tuple should be DECREF'ed at the end of the function. Otherwise the patch is fine. -- nosy: +amaury.forgeotdarc ___ Python tracker <[EMAIL PROTECTED]>

[issue4067] ast.fix_missing_locations() breaks if node doesn't have "_attributes" variable

2008-10-07 Thread Armin Ronacher
Armin Ronacher <[EMAIL PROTECTED]> added the comment: The root of the problem is that ast.AST doesn't have _fields or _attributes. I think the better solution is to add these attributes to the root class which makes it easier to work with these objects. I attached a diff for asdl_c.py which fix

[issue4067] ast.fix_missing_locations() breaks if node doesn't have "_attributes" variable

2008-10-07 Thread Marcin Bachry
New submission from Marcin Bachry <[EMAIL PROTECTED]>: ast.fix_missing_locations() fails if any node is missing "_attributes" instance variable - but it's the case of some fundamental nodes like "alias" or "identifier". When I run simple test: import ast with open(__file__) as fp: tre