Skip to content

Commit

Permalink
Correct slash direction for .pth files on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams committed May 3, 2010
1 parent f9d479c commit 770930d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pip/req.py
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,11 @@ def __init__(self, pth_file):
self._saved_lines = None

def add(self, entry):
# On Windows, entries that describe absolute paths outside of
# site-packages are written with backslashes, but all the
# others use forward slashes.
if sys.platform == 'win32' and not os.path.splitdrive(entry)[0]:
entry = entry.replace('\\','/')
self.entries.add(entry)

def remove(self):
Expand Down

0 comments on commit 770930d

Please sign in to comment.