Commits

Anonymous committed 7efc51c

exceptions: moved BadIdentiferError to rope.base.exceptions

  • Participants
  • Parent commits cc99a03

Comments (0)

Files changed (4)

rope/base/evaluate.py

 import rope.base.builtins
-import rope.base.exceptions
 import rope.base.pynames
 import rope.base.pyobjects
 from rope.base import ast, astutils, exceptions, pyobjects
 from rope.base.codeanalyze import WordRangeFinder
 
 
+BadIdentifierError = exceptions.BadIdentifierError
+
 def get_primary_and_pyname_at(pymodule, offset):
     """Find the primary and pyname at offset"""
     pyname_finder = ScopeNameFinder(pymodule)
     return evaluator.result
 
 
-class BadIdentifierError(rope.base.exceptions.RopeError):
-    pass
-
-
 class ScopeNameFinder(object):
 
     def __init__(self, pymodule):

rope/base/exceptions.py

     """Attribute not found exception"""
 
 
+class BadIdentifierError(RopeError):
+    """The name cannot be resolved"""
+
+
 class ModuleSyntaxError(RopeError):
     """Module has syntax errors
 

rope/contrib/codeassist.py

             try:
                 function_pyname = rope.base.evaluate.\
                     get_pyname_in_scope(scope, primary)
-            except rope.base.evaluate.BadIdentifierError, e:
+            except exceptions.BadIdentifierError, e:
                 return {}
             if function_pyname is not None:
                 pyobject = function_pyname.get_object()

rope/refactor/occurrences.py

     def get_pyname(self):
         try:
             return self.tools.name_finder.get_pyname_at(self.offset)
-        except evaluate.BadIdentifierError:
+        except exceptions.BadIdentifierError:
             pass
 
     @_cacheit
     def get_primary_and_pyname(self):
         try:
             return self.tools.name_finder.get_primary_and_pyname_at(self.offset)
-        except evaluate.BadIdentifierError:
+        except exceptions.BadIdentifierError:
             pass
 
     @_cacheit