158 import builtins |
158 import builtins |
159 self.__builtins = [b for b in dir(builtins) |
159 self.__builtins = [b for b in dir(builtins) |
160 if b not in self.BuiltinsWhiteList] |
160 if b not in self.BuiltinsWhiteList] |
161 |
161 |
162 self.__eradicator = Eradicator() |
162 self.__eradicator = Eradicator() |
163 |
163 |
164 # statistics counters |
164 # statistics counters |
165 self.counters = {} |
165 self.counters = {} |
166 |
166 |
167 # collection of detected errors |
167 # collection of detected errors |
168 self.errors = [] |
168 self.errors = [] |
286 Private method to generate an AST for our source. |
286 Private method to generate an AST for our source. |
287 |
287 |
288 @return generated AST |
288 @return generated AST |
289 @rtype ast.AST |
289 @rtype ast.AST |
290 """ |
290 """ |
291 source = "".join(self.__source) |
291 return ast.parse("".join(self.__source), self.__filename) |
292 return compile(source, self.__filename, 'exec', ast.PyCF_ONLY_AST) |
|
293 |
292 |
294 def run(self): |
293 def run(self): |
295 """ |
294 """ |
296 Public method to check the given source against miscellaneous |
295 Public method to check the given source against miscellaneous |
297 conditions. |
296 conditions. |