222 |
222 |
223 @return generated AST |
223 @return generated AST |
224 @rtype ast.AST |
224 @rtype ast.AST |
225 """ |
225 """ |
226 source = "".join(self.__source) |
226 source = "".join(self.__source) |
227 # Check type for py2: if not str it's unicode |
|
228 if sys.version_info[0] == 2: |
|
229 try: |
|
230 source = source.encode('utf-8') |
|
231 except UnicodeError: |
|
232 pass |
|
233 |
|
234 return compile(source, self.__filename, 'exec', ast.PyCF_ONLY_AST) |
227 return compile(source, self.__filename, 'exec', ast.PyCF_ONLY_AST) |
235 |
228 |
236 def getConfig(self): |
229 def getConfig(self): |
237 """ |
230 """ |
238 Public method to get the configuration dictionary. |
231 Public method to get the configuration dictionary. |