Anonymous avatar Anonymous committed 53abd1c

pyobjectsdef: using prevent_recursion for _create_concluded_attributes()

Comments (0)

Files changed (1)

rope/base/pyobjectsdef.py

 import rope.base.builtins
 import rope.base.oi.soi
 import rope.base.pyscopes
-from rope.base import pynamesdef as pynames, exceptions, ast, astutils, pyobjects, fscommands, arguments
+from rope.base import (pynamesdef as pynames, exceptions, ast,
+                       astutils, pyobjects, fscommands, arguments, utils)
 from rope.base.pyobjects import *
 
 
                 node = ast.parse('\n')
         self.source_code = source
         self.star_imports = []
-        self.making_concluded = False
         self.visitor_class = _GlobalVisitor
         super(PyModule, self).__init__(pycore, node, resource)
 
             raise exceptions.ModuleSyntaxError(filename, 1, '%s' % (e.reason))
         return source_code, ast_node
 
+    @utils.prevent_recursion(lambda: {})
     def _create_concluded_attributes(self):
-        if self.making_concluded:
-            return {}
-        try:
-            self.making_concluded = True
-            result = {}
-            for star_import in self.star_imports:
-                result.update(star_import.get_names())
-            return result
-        finally:
-            self.making_concluded = False
+        result = {}
+        for star_import in self.star_imports:
+            result.update(star_import.get_names())
+        return result
 
     def _create_scope(self):
         return rope.base.pyscopes.GlobalScope(self.pycore, self)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.