Book a Demo

Author Topic: Python code import issues in EA v8.  (Read 3041 times)

Olly B

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Python code import issues in EA v8.
« on: January 08, 2011, 04:35:05 am »
Hi,

When attempting to import/reverse engineer some Python code into the trial version of EA 8.0.864, I found some errors parsing perfectly working and executing (on a python 2.6.5 interpreter) code:

The following snippets have been copied to a separate file, with the parse error occurring in just these snippets.

1      class class1(object):
2      
3              def __init__(self,param1=0L):
4      
5                  if isinstance(param1, str):
6                      var1 = long(param1,16)
7                  else:
8                      var1 = long(param1)

There was an error parsing <path_to_file>\class1.py on line 7.  Unexpected symbol: :      

1      class class2(object):
2            
3          @property
4          def attrib1(self):
5              retVal = self.attrib1
6              return retVal
7              
8          @attrib1.setter
9          def attrib1(self, value):
10              self.attrib1 = value

There was an error parsing <path to file>\class2.py on line 8.  Unexpected symbol: .      

(NB: line 8 - "@attrib1.setter" parses fine if the attrib1 getter method isn't present)

1      class class3(object):
2      
3          def method1(self, arg1, arg2=lambda a: a):
4              self.attrib1 = arg1
5              self.attrib2 = arg2
6      

There was an error parsing <path to file>\class3.py on line 5.  Unexpected symbol: <<DEDENT>>      

With the real file that was being imported, I got the following, but can't recreate it in the code snippet (line number corrected to line numbers above):

There was an error parsing <path to file>\<filename>.py on line 3.  Unexpected symbol: :      


Please could you investigate. In all cases I would expect the code to be parsed without issue.

Thanks
Olly