Commits

Ali Gholami Rudi  committed 69e68fa

transform: use libutils.relative() in path_to_resource()

  • Participants
  • Parent commits a5ab8e5

Comments (0)

Files changed (1)

File rope/base/oi/transform.py

                 return i + 1
 
     def path_to_resource(self, path):
+        import rope.base.libutils
         root = self.project.address
-        if os.path.isabs(path) and (path == root or
-                                    path.startswith(root + os.sep)):
-            path = path[len(root):].replace(os.sep, '/')
-            if path.startswith('/'):
-                path = path[1:]
+        relpath = rope.base.libutils.relative(root, path)
+        if relpath is not None:
+            path = relpath
         return super(DOITextualToPyObject, self).path_to_resource(path)