From 2ca94fb010c11aa99d1477c9bc2f79411903792d Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Thu, 3 May 2018 08:50:08 -0700 Subject: [PATCH] normpath(abspath()) for path comparison --- pipenv/project.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pipenv/project.py b/pipenv/project.py index 73356e61..22b230b8 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -623,7 +623,11 @@ class Project(object): ) data[section][package].update(_data) formatted_data = toml.dumps(data).rstrip() - if os.path.abspath(path) == os.path.abspath(self.pipfile_location): + + def clean_path(path): + return os.path.normpath(os.path.abspath(path)) + + if clean_path(path) == clean_path(self.pipfile_location): newlines = self._pipfile_newlines else: newlines = DEFAULT_NEWLINES