Commits

Anonymous committed a94bd92

pyobjects: passing file name to ast.parse

Comments (0)

Files changed (1)

rope/base/pyobjectsdef.py

                     source_bytes = fscommands.unicode_to_file_data(source_code)
                 else:
                     source_bytes = source_code
-            ast_node = ast.parse(source_bytes)
+            ast_node = ast.parse(source_bytes, filename=filename)
         except SyntaxError, e:
             raise exceptions.ModuleSyntaxError(filename, e.lineno, e.msg)
         except UnicodeDecodeError, e: