Commits

Anonymous committed 0ff9009

libutils: fix relative() on windows

Reported by Darren Syzling.

Comments (0)

Files changed (1)

rope/base/libutils.py

 def relative(root, path):
     root = rope.base.project._realpath(root)
     path = rope.base.project._realpath(path)
+    if os.name == 'nt':
+        root = root.rstrip('\\')
+        if path.startswith(root):
+            return path[len(root):]
+        return
     rel = []
     while True:
         try: